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
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
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.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F6fce8742-cc7e-4301-a659-4aa9849c80b3%2F8535ab51-8905-4eac-a4d8-ae1eb23908ff%2F6wgsfp_processed.jpeg&w=3840&q=75)
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.

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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images

Recommended textbooks for you

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage

Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,

C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr

EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT