Computers and Technology

Create the following class Car
class Car extends Vehicle implements Comparable, Announcements:

numDoors: int
numWindows: int
Car(int numDoors, int numWindows) //SEE NOTE 1
Car(int numDoors, int numWindows, int numSeatsPerRow ) //SEE NOTE 2
Car(int numDoors, int numWindows, int [ ] numSeatsPerRow ) //SEE NOTE 3
Car(int numDoors, int numWindows, Person driver, int [ ] numSeatsPerRow) //SEE NOTE 4
canOpenDoor(Person p): boolean //SEE NOTE 5
canOpenWindow(Person p): boolean //SEE NOTE 6
getNumDoors(): int
getNumWindows(): int
equals(Object o): boolean //SEE NOTE 7
toString(): String //SEE NOTE 8
compareTo(Car c): int //SEE NOTE 9

Notes for Class Car:
1. This constructor calls the parent class's constructor, passing in 2 for the numRows and 2 for the numSeatsPerRow, before assigning the numDoors and numWindows values.
2. This constructor calls the parent class's constructor passing in 2 for the numRows and the numSeatsPerRow argument, before assigning the numDoors and numWindows values.
3. This constructor calls the parent class's constructor passing in the numSeatsPerRow[] array as an argument, before assigning the numDoors and numWindows values.
4. This constructor calls the parent class's constructor passing in the driver and the numSeats PerRow[] array, before assigning values to numDoors and numWindows.
5. This method returns true if the Person is seated in either of the exterior seats of a row that has a door (column index 0 or last index of that row) and is over age 5. It returns false otherwise. If the number of doors is less than 2. numberOfRows, the row/s past numDoors /2 has/have no doors.
6. This method returns true if the Person is seated in either of the exterior seats of a row that has a window (column index 0 or last index of that row) and is over age 2. It returns false otherwise. If the number of windows is less than 2* numberOfRows, the row's past numWindows /2 has/have no windows.
7. Two Car objects are considered equal if they have the same numDoors, same numWindows, same numberOfRows, same maxSeatsPerRow, and the same seat configuration (numSeatsPerRow[row]) at every row.
8. Return a string containing the Car's details formatted as follows: "Car: number of doors= %02d | number of windows = %02d number of rows %02d seats per row- %s names of people on board=%s\n" The seats per row will be from the array of numSeatsPerRow as (val1, val2,val3, valn) The names of people on board will be separated by commas with no trailing comma.
9. This method returns - 1 if the calling object's total number of seats is less than the passed in object's total number of seats, 1 if the calling object's total number of seats is greater than the passed in object's total number of seats, 0 if they have the same total number of seats.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:30, gg68814
1.the index finger on your right hand types the f r v 4 j u m 7 h y 6 n lo.9 j u 7 m g t 5 b 2.if you need to multiply 400, 2, and 1 ½, what would you type on the numeric keypad? 400*2*1.5 400/2*1.5 400/2/1.5 400*2*1½ 3.select all examples of proper keyboarding technique. rest your fingers gently on the home row or home keys. slouch in your chair. rest your palms on the keyboard. relax your fingers. keep your hands lower than your elbows.
Answers: 1
image
Computers and Technology, 22.06.2019 22:00, noeminm105
Consider the following declarations (1, 2, 3, 5, 7)class bagtype{public: void set(string, double, double, double, double); void print() const; string getstyle() const; double getprice() const; void get(double, double, double, double); bagtype(); bagtype(string, double, double, double, double); private: string style: double l; double w; double h; double price; }; a.) write the definition of the number function set so that private members are set according to the parametersb.) write the definition of the member function print that prints the values of the data membersc.) write the definition of the default constructor of the class bagtype so that the private member variables are initialized to "", 0.0, 0.0, 0.0, 0.0, respectively d.) write a c++ statement that prints the value of the object newbag. e.) write a c++ statement that declares the object tempbag of type bagtype, and initialize the member variables of tempbag to "backpack", 15, 8, 20 and 49.99, respectively
Answers: 3
image
Computers and Technology, 23.06.2019 00:10, makailaaa2
My has been slow anyone else’s ?
Answers: 1
image
Computers and Technology, 23.06.2019 07:30, jackie0833
Which option allows you to view slides on the full computer screen?
Answers: 1
Do you know the correct answer?
Create the following class Car
class Car extends Vehicle implements Comparable, Announcements...

Questions in other subjects: