Question
C# Programming For this project youre going to create a console application with two classes in addition to the Program.cs class thats generated when you
C# Programming
For this project youre going to create a console application with two classes in addition to the Program.cs class thats generated when you create a new Console Application project. Dont change the name of Program.cs.
The first class will be called StudentClass and will have the following private attributes with associated getters and setters:
String Name, String Major, String GraduationYear, Double GPA.
The second class will be called EmployeeClass and will have the following private attributes with associated getters and setters:
String Name, String Department, Double Salary.
Along with the private attributes for each class youll create a getter and setter for each attribute as well as a constructor in which youll pass the data in through the parameters and set the properties in that constructor method. Youre going to create a menu that gives the user options to: Add a student / Add an employee / View all students / View all employees / Exit.
If they choose View all Students or View all Employees and none have been entered then youre going to tell them that none have been entered.
Pressing any key will bring them back to the menu. If they select Add a Student then youre going to clear the screen and prompt them for each attribute one by one.
You will code your app for error checking so that if the user doesnt enter anything for a string value you will prompt them that the value cant be null and you will prompt them again.
If they enter anything other than a number for Student GPA or Employee Salary then youll tell them that they need to enter a number.
Once you have valid input for the student or employee then youre going to store the students in a List of StudentClass Objects, and the employees in a List of EmployeeClass Objects.
When the user wants to view students or employees youll check the count of the List and if the count is zero then thats when youll tell them that there are none saved.
If there are records saved then youll list them in a neatly formatted way.
* *** *** ****** ***** **** ** :007atas e axew *** **** *** ******** * 71X3 (S 4) View all Employees 3) View all Students akordusue PPY (Z quapnis e PPF (T ******************************************* nuaw ako i dus/tuapnis ******************************************* ************************************* View Students You have not added any students yet. Press any key to continue View Employees ************************************* You have not added any employees yet. Press any key to continue Add Student Inter student full name: Joe Smith Enter student major: Accounting Enter student! graduation year: 2018 Enter student's GPA: 3.9 Student added. Press any key to continue uuuu Add Employee Enter emplo full name: Alice Jones Enter employ ee's department: Billing Enter employee's salary: 29000 Employee added. Press any key to continue Add Student Enter student's full name : Your answer cannot be empty. Please try again! Enter student's full name: Add Employer Enter employee's full name: Ed Smith Enter employ department: Maintenance Enter employee's salary: none That is not a valid number. Please try again! Enter employee's salary: View Students ************************************* You have not added any students yet. Press any key to continue RRRRRRRR Name Major Graduation Year Grade Point Average Joe Mama Alyin Chipmunk Delores Jones Press any key to continue CIS Art Sociology Salary View Employees *************** ***************** Name Department --------------- Jamie Somers Management Steve Austin Press any key to continue $ 77000.5
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