Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Describe 2 pieces of information that should be included in the block comment of

ID: 3840047 • Letter: D

Question

Describe 2 pieces of information that should be included in the block comment of a method (it doesn't have to be JavaDoc style) Give two variables, x and y, that represent the coordinates of a point, write a Boolean expression that is true if the point is not on an axis, false if not. Draw what the object diagram would be after the client code executes. Also show what would be displayed. public class Zoo {private int cat, lion; public Zoo(int a) {lion = a; cat = 2 * a + 1;} public int stir(int k){return cat + k * lion;} public void swirl(){int temp = lion - 4; lion + = cat; cat = temp;} public void show () {system.out.println("c = " + cat); system.out.println("1 = " + lion);}} zoo z1 = new zoo (7); Zoo z2 = new Zoo(10; z1.show(); Zoo z3 = z2; z3.show(); z3.swirl(); z2.show(); int x = zl.stir (3) system.out.println(x);

Explanation / Answer

Hi, I have answered first two questions.

Please repost other question in separate post.

Please let me know in case of any issue in answered part.


Q1)

Info that the user of a class needs to know should go into a Javadoc comment.

Info that a developer modifying a class needs to know go into a normal comment (block or line).
Block comments are internal comments, comments you write for people maintaining your code.
Block comments are important to understand how the code works, why it works and which are the operations used to do the actual work.

/*---------------------------------------------------------------------
| Method [Method Name]
|
| Purpose: [Explain what this method does to support the correct
| operation of its class, and how it does it.]
|
| Pre-condition: [Any non-obvious conditions that must exist
| or be true before we can expect this method to function
| correctly.]
|
| Post-condition: [What we can expect to exist or be true after
| this method has executed under the pre-condition(s).]
|
| Parameters:
| parameter_name -- [Explanation of the purpose of this
| parameter to the method. Write one explanation for each
| formal parameter of this method.]
|
| Returns: [If this method sends back a value via the return
| mechanism, describe the purpose of that value here, otherwise
| state 'None.']
*-------------------------------------------------------------------*/

/*
   Purpose : add to integer value
   Pre-condition : two integer value as parameter
*/

public void add(int x, int y){
  
}


/*
   Purpose : add to integer value
   Pre-condition : two integer value as parameter
   Post-condition : return addition result of two integer value
*/

public int add(int x, int y){
  
}

Q2)

Given x, y

   Boolean expression that return true if point is not on x-axis

   x != 0

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote