Sale!

ECE 39595 HW 1 solved

Original price was: $35.00.Current price is: $30.00. $25.50

Category:

Description

5/5 - (3 votes)

Part A: Using an IDE, run the simple Java program included with this homework in HW1/A/Address.java in an IDE. NetBeans is a good one. Take a screen shot of the screen after running the program in the IDE, and turn it in to Brightspace. Part B Part i. Write a Java program that contains as its only class an Automobile class. The class has variables to hold a vehicle identification number that can be represented as an integer, miles driven, which can be represented as a float, and the date of the last maintenance, which should be stored as a String. A class attributes (variables) should be private. Automobile should have a getter for each of the above values. The getter for the maintenance date returns a String. The statement for forming the string for the date is String str = “”+month+”/”+day+”/”+year; The constructor for automobile takes values for each of the variables, and for the month, day and year, i.e., it will take an int, float, int, int and int. A separate class, HW1.java, contains the main function. It should call the constructor twice to create two Automobile objects, and then print out the values of each automobile using System.out.println; Part ii. Take the Automobile class above and store the maintenance date as three integer values, month, date and year, instead of as a String. The getters and setters for the date should still take three integers and return a String, respectively. You should be able to run an unchanged HW1.java against the changed Automobile class and get the same results you got with the original Automobile class. How to turn in the homework. Create a directory called , where is your Purdue login. Under that directory should be an A and a B directory. Inside of A directory have the screenshot for A. Inside of the B directory have two directories, 1 and 2. Inside the 1 directory have the code for part i above. Inside the 2 directory have the code for part ii above Turn in the code to Brightspace.