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

Use the first question to answer number 32! Don\'t answer 31! Need in 30 Minutes

ID: 3867435 • Letter: U

Question

Use the first question to answer number 32! Don't answer 31! Need in 30 Minutes, thank you. JAVA -EXAM 3 SUMMER 2017 INSTRUCTOR: A. SAHBA NAME 5 2033-SECTION DATE: Il Coding, Analysis, and Interpretation: For all problems follow proper coding guidelines with regard to punctuation, spacing, syntax, etc. Use printfo (with format specifiers as needed) for prompts and output. Do not write in all caps except where permitted according to Java rules. Class programs are programs without a maino. Fields and methods in stand-alone class programs are not static. Application classes are programs with a main). Be sure to exit the main. Unless otherwise indicated, classes and their Test programs are in the same directory. READ carefully all the instructions 31. Car is a class program. Car has a no-args/empty constructor and an overloaded constructor that accepts the year, make, and model and stores each in their respective fields (class-level variables) of the same name. It has a carsBought method that retums the number purchased for that specific year, make, and model through a prompt. Also code a method called objectState that returns the formatted output for the fields according to the specs below. (10 points) FORMATTED OUTPUT SPECS: Year, Make, & Model: 9999 Xxxxxxxxxx Xxxxxxxxx

Explanation / Answer

TestCar.java

class TestCar{

public static void main(String args[]){

Car car1 = new Car(1955,"Ford","Thunderbird");

Car car2 = new Car(1984,"Aston Martin","Series 2 DB4");

printf("Year, make, & Model : %s Number Purchased : %s",car1.carsBought(), car1.objectState());

printf("Year, make, & Model : %s Number Purchased : %s",car2.carsBought(), car2.objectState());

}

}

--------------------------------------------------------------

PLEASE RATE !!

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