subject

Given a class called Measure that has the methods and data as specified, choose the correct code to satisfy the requirements of the class. public class Measure implements Comparable

{

//Instance variables yards, feet, inches;

//Constructors (default and overloaded)

//Accessors for yards, feet, and inches

//Mutators for yards, feet, and inches

//totalInches returns an int of the total inches for the current object

//toString returns a string in the form: 6 yards, 2 feet, and 5 inches

//Adding 2 measure objects (current object and one passed in as a parameter)

//addMeasure returns a measure object that is the sum of two measure objects,

// the current object and one that is passed in as a parameter

}

Which of the following would be the correct implementation for the method totalInches that returns an int of the total inches for the current object in the measured class? (36 inches = 1 yard)

A. return 36 * feet + 12 * yards + inches;
B. System. out. println(36 * yards + 12 * feet + inches);
C. int total = 36 * yards + 12 * feet + inches;
return total;
D. none of these

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 13:30
Anetwork security application that prevents access between a private and trusted network and other untrusted networks
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
question
Computers and Technology, 24.06.2019 10:10
Which view in a presentation program displays a split window showing the slide in the upper half and a blank space in the lower half?
Answers: 1
question
Computers and Technology, 25.06.2019 00:00
He computer component that disperses heat from the microprocessor to the cooling fan is a cooler thermometer heat sink
Answers: 1
You know the right answer?
Given a class called Measure that has the methods and data as specified, choose the correct code to...
Questions
question
Mathematics, 30.06.2021 05:50
question
Chemistry, 30.06.2021 05:50
question
English, 30.06.2021 05:50
Questions on the website: 13722361