In sample steps please For the questions below the following doss definition Whi
ID: 3684097 • Letter: I
Question
In sample steps please For the questions below the following doss definition Which of the following could be used to instantiate a new Student s_1? Student s1 = new Student(); s_1 = new Student(); Student s1 = new Student("Janc Doe", "Computer Science. 3.333.33); new Student (s1) Assume that another method has been defined that will compute and return the student's class rank (Freshman. Sophomore, etc). It is defined as: pubic Stnng gctClassRank() Given that s1 is a student, which of the following would properly be used to get s1's class rank? s1 = getClassRank(); s1.toString(); s1 get Hours(): s1 getClassRank(); Consider a method defined with the header: public void foo(tit a. int b). Which of the following method calls is legal? Consider a method defined with the header: public void doubkfoo(double x) Which of the following method calls is legal? What happens if you declare a class constructor to have a void return type? You'll likely receive a syntax cm The program will compile with a warning, but you'll per a runtime cm There's nothing wrong with declaring a constructor lo be void The class' default constructor will be used instead of the one you're declaring None of the above When reasoning about a car. we use such information as its make and model year, color, cost (as worth) number of miles, gas mileage, insurance cost and so forth. consider a program that will attempt to determine how practical a car might be on a road trip. which of these types of information might you use in your program as instance data? Provide a justfication for your selectionExplanation / Answer
1)
2)
3)
4)
5)
Answer: A
Explanation:'A constructor does not declare any return type ,not even void.
6)
Answer: Because a road trip will include such factors as comfort and cost, we need to have instance data pertaining to the size of the vehicle, its gas mileage and its reliability. Size can be determined by make and model, reliability based on year and number of miles that the car has accrued, and cost based on gas mileage. The following would be a reasonable selection of instance data: model (maybe make as well), year, number of miles, gas mileage.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.