In a vehicle mileage application, you enter number of miles traveled by a vehicle and the amount of fuel used for 30 consecutive days. From this data the average monthly mileage of the vehicle is calculated. Which of the following should be done to improve the program design?
A) The next time the average monthly mileage is calculated, use copy and paste to avoid making coding errors.
B) Provide the same comment every time you repeat the average monthly mileage calculation.
C) Consider writing a method that returns the average monthly mileage as a double value.
D) Consider writing a method that returns void
Correct Answer:
Verified
Q22: Consider a method named calc, which accepts
Q23: What is the output of the following
Q24: What is the error in the following
Q25: Consider this method comment. Which of the
Q26: What is the syntax error in the
Q28: What is the error in the following
Q29: The Java method Math.round can be used
Q30: In an accounting application, you discover several
Q31: What is the output of the following
Q32: Suppose you need to write a method
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents