Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create an Employee class (Employee.cs) that has the following UML class diagram: Employee Class Fields employeeUserId : int firstName : string - lastName : string
Create an Employee class (Employee.cs) that has the following UML class diagram: Employee Class Fields employeeUserId : int firstName : string - lastName : string - basicSalary: double grossSales : double comissionRate : double Properties + EmployeeUserId : int readonly + FirstName : string + LastName : string + BasicSalary: double + GrossSales : double + ComissionRate : double Methods + Earnings() : double + constructor Employee() + constructor Employee (employeeUserId : int, firstName : string, basicsalary: double) Employee User ID, first name, last name, base salary, gross sales (amount in dollars) and commission rate. Define their data types appropriately. Define read only property for employee User ID. Use default value of 2000.00 dollars for base salary for all the employees. Commission rate should be set by default to 0.2. Class should have defined two overloaded constructors: One, without parameters, for initializing all the instance data members Second for initializing employee User ID, first name, base salary only. Define a public method called earnings which calculates employee's commission (commission rate * gross sales + base salary) b) (15 marks] - Rename Program class to Employee Test. In the Main() method of the Employee Test class, create two objects of the type Employee. Each to demonstrate the use of a different constructor that has been created . For the second object, ask the user to enter first name, last name, base salary, gross sales and commission rate. . After the user enters all information, the application will calculate Earnings and display it formatted as currency. Gross sales and commission rate should never be negative or zero. You need check and validate that the user is entering an acceptable value. Commission rate should be between 0.1 (10%) and 1.0 (100%). You need check and validate that the user is entering an acceptable value. Aspects that will be evaluated: Proper identifier casing Correct implementation of classes instance variable declarations, constructors, getter and setter methods) Declaring and creating objects, calling their methods, interacting with user, displaying results Comments, correct naming of variables, methods, classes Friendly input/output
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started