View the step-by-step solution to:

Question

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.


I'm not sure how to set up the start of the code and the while loop.

Top Answer

Problem Statement The information of persons is entered into the system. For a particular person, the information contains... View the full answer

1.PNG

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question