Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a.o. Programming II Page 2 of 3 Exercise: a) [15 marks] - Write a C# application using Visual Studio as IDE, that implements the following

a.o. Programming II Page 2 of 3 Exercise: a) [15 marks] - Write a C# application using Visual Studio as IDE, that implements the following class as per business requirements mentioned below: 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: o One, without parameters, for initializing all the instance data members o Second for initializing employee User ID, first name, base salary only. Define a public method called earnings which calculates employees commission ( commission rate * gross sales + base salary ) Assignment 2 Classes and Objects a.o. Programming II Page 3 of 3 b) [15 marks] Rename Program class to EmployeeTest. In the Main() method of the EmployeeTest 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,

USING c# PLZ DO PART A AND B

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions

Question

=+j Explain the essential nature of repatriation.

Answered: 1 week ago