Sale!

COMP 231 Assignment 2 solved

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

Category:

Description

5/5 - (5 votes)

(Use Chapter 9+ String Only)
Objectives:
1. Create Classes and Objects. 2. Process Array of objects. 3. To use the String class to process immutable strings. Palestinian Car Agency:
A car has many attributes. Consider underneath car has the following attributes
Plate No 0123-A
Year manufacture Current year
Month manufacture Current moth
color red
price 50,000.00
Manufacture by Mercedes
Guarantee due to year Current year
Guarantee due to month Current moth+6
 Create a car class using at least the following 8 attributes: Plate No, Year manufacture,Monthmanufacture, color, and price. Note that both current year and moth are read fromsystem.  Create two constructors as follow:
No-argument constructor: that creates a car object using the default “Mercedes Benz” valuesinaboveexample. A constructor with arguments using the basic 8 attributes that mentioned before.
2
 Your assignment should use the following two chart of UML:
Class Driver for Palestinian Car Agency:
Note that
1. getCarAge() method must calculate the age of car in years and months andreturndataas string type.
2. getCalculateGuarantee() method should calculate the reaming years and monthsforguarantee.
3. Guarantee date should contains the years and months remain for cars fromcurrentdate.4. All Output string should be printed in UPPER case.
5. print all information about cars with ages and guarantee due to inside classdriver.Write a driver class that creates an array of 5 [ do not create scanner, initialize them inside class driver ] Cars thenpassesthearray to the two underneath methods :
1. public static void printCarsInfo( Car [ ] cars){
//print all information about cars with ages and guarantee due to.
}
2. a method named MaxPrice which will return the car object with the maximum price. public static Car maxPrice( Car [ ] cars) {
}
Car -PlateNo:String
-yearmanufacture:int
-monthmanufacture:int
-color:String
-price:double
-manufactureby:String
-guaranteedueyear:int -guaranteeduemonth:int
+Car()
+Car(String PlateNo,intyearmanufacture ,int
monthmanufacture ,String color,double
price,String manufactureby,guaranteedueyear
int,guaranteeduemonth int)
+getYearManufacture():int
+getMonthManufacture():int
+getColor():String
+getPrice():double
+setYearManufacture(int year):void
+setMonthManufacture(int month):void
+setColor(String color):void
+setGuarantee(int month,int year):void
+getCarAge():String
+printCarInfo():String
+getmanufactureby():String
+getCalculateGuarantee():String
3
Set of instructions:
1.Create folder at your desktop with your Assignment#, ID, and your name
Example: A2_1190100_Ali Mohammad
2. Create a new project using Eclipse IDE and store your project inside this folder. 3.Zipped this folder and submit it by your ITC account [under meta course ]. Grading policy and general notes on the Assignment:1. Your application should have all functionalities working properly. Twenty percent of marks will be
graded for the functionality of the assignment. 2. The following notes will make up the remaining 10 marks of the grade:
a. There has to be adequate documentation and comments in the code(i.e., methods, loops, etc.);
b. Your code should follow the code convention (i.e., spaces, indentations,etc.); and
3. Any plagiarized code will not be marked. 4. ANY LATE Assignment will never be accepted for any excuse. Types of cheating:
Types of cheating:
1. Getting codes form outsource, like books, internet. 2. Cheating from any classmate. 3. Trying to get answers from any website. 4. Trying to get answers from the Facebook groups or from any social media. 5. Trying to get answer from Chegg website. Deadline: Monday