UML Diagram Employee 0..500 Car Partial Java Code 1 public class Employee{ 2 //Static Variables 3 public static final int MAX_CAR_ON_LOT = 500; 4 private static int lastEmployeeNumberUsed; 5 private static int noOfCarsSold; 6 7 //Instance Variables 8 private int employeeNumber; 9 private String firstName; 10 private String lastName; 11 private Car[] carsSold; 12 13 14 //Your Code Here 15 16} 2 Note: You may assume that the Employee object and carsSold array have already been instantiated. Remember to think about the appropriate validation. Question 5 6 out of 10 points You work for a Car dealership. Your boss has asked you for your help to improve revenue and drive bunisess. In order to do this, you must review all the Car sales by an Employee. Given the UML diagram and parital Java code below, write, in Java, the addSale (mutator) method which adds a Car object to the Emloyee's instance variable Car array SalesMade. The addSale method should take in the make (string), model (string) and price (double) of the car sold. In order to instaintiate a Car object, you must have the make, model and price. UML Diagram Employee 1 0..500 Car Partial Java Code 1 public class Employee( 2 //Static Variables 3 public static final int MAX_CAR_ON_LOT = 500; 4 private static int lastEmployee Number Used; 5 private static int noOfCarsSold; 6 7 //Instance Variables 8 private int employeeNumber; 9 private String firstName; 10 private String lastName D

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question

Please answer this JAVA OOP problem.

UML Diagram
Employee
0..500
Car
Partial Java Code
1 public class Employee{
2
//Static Variables
3 public static final int MAX_CAR_ON_LOT = 500;
4
private static int lastEmployeeNumberUsed;
5
private static int noOfCarsSold;
6
7 //Instance Variables
8 private int employeeNumber;
9 private String firstName;
10 private String lastName;
11 private Car[] carsSold;
12
13
14
//Your Code Here
15
16}
2
Note: You may assume that the Employee object and carsSold array have already been instantiated. Remember to think about the
appropriate validation.
Transcribed Image Text:UML Diagram Employee 0..500 Car Partial Java Code 1 public class Employee{ 2 //Static Variables 3 public static final int MAX_CAR_ON_LOT = 500; 4 private static int lastEmployeeNumberUsed; 5 private static int noOfCarsSold; 6 7 //Instance Variables 8 private int employeeNumber; 9 private String firstName; 10 private String lastName; 11 private Car[] carsSold; 12 13 14 //Your Code Here 15 16} 2 Note: You may assume that the Employee object and carsSold array have already been instantiated. Remember to think about the appropriate validation.
Question 5
6 out of 10 points
You work for a Car dealership. Your boss has asked you for your help to improve revenue and drive bunisess. In order to do this, you must
review all the Car sales by an Employee.
Given the UML diagram and parital Java code below, write, in Java, the addSale (mutator) method which adds a Car object to the Emloyee's
instance variable Car array SalesMade.
The addSale method should take in the make (string), model (string) and price (double) of the car sold.
In order to instaintiate a Car object, you must have the make, model and price.
UML Diagram
Employee
1
0..500
Car
Partial Java Code
1 public class Employee(
2
//Static Variables
3 public static final int MAX_CAR_ON_LOT = 500;
4
private static int lastEmployee Number Used;
5 private static int noOfCarsSold;
6
7
//Instance Variables
8 private int employeeNumber;
9 private String firstName;
10 private String lastName
D
Transcribed Image Text:Question 5 6 out of 10 points You work for a Car dealership. Your boss has asked you for your help to improve revenue and drive bunisess. In order to do this, you must review all the Car sales by an Employee. Given the UML diagram and parital Java code below, write, in Java, the addSale (mutator) method which adds a Car object to the Emloyee's instance variable Car array SalesMade. The addSale method should take in the make (string), model (string) and price (double) of the car sold. In order to instaintiate a Car object, you must have the make, model and price. UML Diagram Employee 1 0..500 Car Partial Java Code 1 public class Employee( 2 //Static Variables 3 public static final int MAX_CAR_ON_LOT = 500; 4 private static int lastEmployee Number Used; 5 private static int noOfCarsSold; 6 7 //Instance Variables 8 private int employeeNumber; 9 private String firstName; 10 private String lastName D
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT