Question: Part A. Short Answer (1 point): 1. Pick your poison- circle and answer a or b (I will only grade one) a. Objects should be
Part A. Short Answer (1 point): 1. Pick your poison- circle and answer a or b (I will only grade one) a. Objects should be self-governing. Explain We have been diligent about declaring class instance variables to be private, why might a final variable be given public visibility? b. Part 2. Coding (8 points) Using the papers attached, hand-write code for the following problem The Classy Cars dealership sells only 4 makers of classy, sports cars (Lamborghini, Bugatti, Ferrari, and Pagani). Each car is available in Red or Black. 1. Write a Java class for SportsCar that satisfies the description above and consists of class instance variable members a. The Maker (you need to code an enumerated type for the Maker) b. The color (only comes in red or black) c. The price of the car 2. Your Java class named SportsCar above should include (only) the following methods: (5 points) a. a default Constructor that sets the properties for a Red Bugatti that costs $425,000 b. Set methods for the SportsCar's Maker and Color. c. Get methods for the SportsCar's Maker and price d. A toString() method that Lists the Maker, Color, and price of a car 3. In the TestSC class main method, write code to: (1.5 points) a. instantiate a SportsCar object b. Set its maker to Ferrari. c. Invoke its toString method in a System.out.printin() method package testsc: ADD YOUR NAME AS AUTHOR! * author CODE THE ENUMERATED TYPE HERE ublic enum Makeri public class Sportcar 1.1 of 2 2019.03.12 15:39.26 ackage testsc; PUT YOUR NAME AS AUTHOR! *@author public class TestSC t @param args the command line arguments public static void main(Stringl) args)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
