a. Contain private data members

a) In your Word doc, create an algorithm using pseudocode and 3 levels of top-down

refinement to model this problem – that is top, 1st, and 2nd levels of pseudocode.

Use the reserved words provided to you in the “Pseudocode Reserved Words”

document.

[This program is so simple that it hardly requires pseudocode at all, let alone 3 levels.

Remember that the purpose of this task is to test your understanding of pseudocode,

not so much to help you with writing the C# code] (7 marks)

b) Convert the 2nd level pseudocode into a C# application. (20 marks)

If you write all your code in a single class you can get a maximum of 10 marks. If you

create 2 classes as described here you can get 20 marks.

Your Main method should contain the Console.ReadLine() code that asks for hours

worked and rate of pay. It should also contain code that creates 3 Employee

objects from a second class called Employee.

This Employee class should:

a. Contain private data members

b. Contain a Constructor that sets an employee’s rate and hours to 0

c. Contain Rate and Hours “Properties” that set and get the private data

members. The set method should validate user input

d. Contain a setEmployee() method that sets both the rate and hours worked

e. Contain a displayEmployee() method that displays an employee’s details

exactly as shown on the following page’s test data

Your program should not crash if invalid input (such as a String) is entered into the

console and it shouldn’t treat negative values as acceptable. See the test data on the

following page to see how invalid input should be treated.

Your code should make use of the each Property’s set methods for the first 2 employees

and the setEmployeeYou will get a bonus of up to 5 marks if you implement an array of 3 employee objects

and use for loops to process the inputs and displays for that array. If you do this, then

use the default constructor and the Properties for each employee (not the

setEmployee() method, which you still need to create).

c) When you run the program, enter the data for 3 employees using different data to the

test data used below here, and include a screenshot(s) of the console in your Word

doc. (2 marks)

d) Write into your Word doc the name of the exe created by compiling your application

and the relative path from your project’s .sln file to that exe e.g.

“/source/bin/exe/employees.exe” (1 marks)

e) Copy and paste your completed code into your Word doc. As instructed above, be sure

to submit your Visual Studio solution along with your Word doc

You can test and debug your application with this employee data:() method for the 3rd.



Price: £ 12

100% Plagiarism Free & Custom Written, Tailored to your instructions

Leave your Comments


Can't read the image? click here to refresh