Question: Lab Assignment #7 In this exercise, you use what you have learned about writing methods that return a value to answer Questions 1-2. 1 .

Lab Assignment #7 In this exercise, you use what you have learned about writing methods that return a value to answer Questions 1-2. 1 . Given the following variable declarations and method calls (assume that a class object named object has been created/declared), write the method's header: a. double price, percent, newPrice: new Price - object.calculateNewPrice(price, percent); b. double perimeter, one_length, two length: perimeter - object.calcPerimeter(one_length, two length); c. String lowerCase, upperCase; lowerCase = object.changeCase(upperCase); 2. Given the following method headers (assume that a class object named object has been created/declared), write a method call statement: a. public String findItemType(int itemNumber) b. public int squared(int num], int num2) c. public int power(int num, int exp) 3. This keyword causes a value to be sent back from a method to the statement that called it. 4. When passing an argument to a method, the argument's data type must be compatible with the data type. 5. What is the difference between an argument and a parameter variable? 6. What is the difference between a void method and a value-returning method? 7. What does the Java method signature consist of or contain? 8. Look at the following Java method header: public int myMethod(int numA, int numB, int numC) Now look at the following call to myMothod: System.out-printIn(myMethod(9, 2, 7)); When this call statement executes, what value will be stored in numA? What value will be stored in numB? What value will be stored in numC? 9. When a method is executing, what happens when the end of the method is reached? 10. What is a local variable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
