COIS 1020 Programming for Computing Science - 100336

Solution Posted by
assignment4

assignment4

Rating : No Rating
Solution Detail
Price: $15.00
  • From: Computer Science,
  • Posted on: Fri 23 Oct, 2020
  • Request id: None
  • Purchased: 0 time(s)
  • Average Rating: No rating
Request Description
You have been approached by the Statistics Canada to create a C# program to calculate the average salary of people with university degrees, college diplomas, and high school diplomas. Using a while loop, you are to process salary data until the user indicates that you should stop (there could be 0 or more data values). For each person processed, the program must first input an education type (char edType) (‘U’ or ‘u’ for university degrees, ‘C’ or ‘c’ for college diplomas, and ‘H’ or ‘h’ for high school) and then a salary (double salaryData). The program stops accepting input when the user enters a ‘Q’ or ‘q’ for quit (use a sentinel value while loop). Your main data processing loop should be conditioned on the fact that the user has not signalled quit. It might look something like: while(char.ToUpper(edType) != ‘Q’) This implies that like any sentinel value loop, you must seed the loop (input a value) PRIOR to entering the loop. Inside the loop the salary data is entered and processed. Once the main loop terminates, the average salary for each of the three education types should be printed out. Be sure to print an error message if the user enters an invalid education type or a negative salary. For all assignments, you are to submit: 1. Properly documented source code (.cs file) which includes comments at the top of your program (containing your name, student number, a description of the program), the list of variable names with their uses (data dictionary), and comments within the body of your program (inline comments). 2. Sample output showing your program works using the template that is provided on BlackBoard. This is to be a PDF file that contains one screen shoot of an output window, and several more cut and pastes of sample outputs (use a word processor and then export as a PDF). Please note that one sample output does NOT demonstrate that your program works. Your job is to prove to the marker that your program works for ALL cases.
Solution Description

he following program prompts the user to input the values of the education type and salary.

Attachments
Assignment_1.cs
Assignment_1.cs