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

Question 6 Following subquestions refer to the class definition below: public cl

ID: 3732575 • Letter: Q

Question

Question 6 Following subquestions refer to the class definition below: public class CarPerformance private double currSpeed; private double currAcceli // Constructor definition public CarPerformance ( currSpeed 0.0 currAccel0.0) // Constructor definition public CarPerformance (double speedMph, double accelFpsps) currSpeed speedMph; currAccel accelFpspsi // Other methods. The default constructor initializes the currSpeed field to the value of the parameter speedMph True . False The statement CarPerformance car1 = new CarPerformance(); creates a CarPerformance object with both fields initialized to zero. True False

Explanation / Answer

The default constructor initializes the currSpeed field to the value of parameter speedMph

Ans)False

_______________

The statement CarPerformance car1=new CarPerformance(); creates a CarPerormance object with both fields initialized to zero

Ans) True

_______________

The Statement CarPerformance car2=new CarPerformance(0.0,60.0);

creates a CarPerformance object with the currSpeed field initialized to 60.0 and the currAcc1 field initialized to 0.0

Ans) False

_______________

The reference variable initialization CarPerformance car3=new CarPerformance(25.0); creates a CarPerformance object with the currSpeed field initialized to 25.0

Ans)False

________________Thank You

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