C How To Program Plus Mylab Programming With Pearson Etext -- Access Card Package (8th Edition)
C How To Program Plus Mylab Programming With Pearson Etext -- Access Card Package (8th Edition)
8th Edition
ISBN: 9780134227023
Author: Paul J. Deitel; Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 4, Problem 4.22E
Program Plan Intro

Program plan:

  1. Declare the counter variables for each letter grade, the total counter and the total value of all the grades.
  2. Prompt the user to enter the letter grades.
  3. Declare a WHILE loop in order to continue the process until the user enters the exit character.
  4. The SWITCH statement is used in order to increase the counter of the corresponding letter grades.
  5. Increase the letter grade counter and the total grade counter by one each time and add the value or mark of the grade.
  6. After the user enters the exit character, divide the total value by the count of grades entered in order to obtain the average mark.
  7. Using IF conditions, determine the grade corresponding to the average mark.

Summary Introduction:

To modify the program provided in fig 4.7 to print the average letter grade of the class based on entered letter grades.

Program description:

The main purpose of this program is to take the user entered values for the letter grades of a class and to determine the average grade of the class based on those letters. The program uses a SWITCH statement to count the number of occurrences of each grade and thereafter, it determines the average grade with the help of IF conditions.

Blurred answer
Students have asked these similar questions
Benefits of using arrays as instance variables: What are the advantages of incorporating arrays as instance variables within a class? Initializing and managing arrays: How do you initialize and manage arrays within class constructors and mutators (setters)? Example of using arrays as instance variables: Share an example where you have used arrays as instance variables and discuss its application in a real-world scenario. Common mistakes with arrays as instance variables: What are some common mistakes to avoid when working with arrays as instance variables? Information hiding violations: What is the potential violation of information hiding when using arrays as instance variables? How can this be resolved?
Do you think that computers should replace teachers? Give three references with your answer.
Is online learning or face to face learning better to teach students around the around the world? Give reasons for your answer and provide two references with your response. What are benefits of both online learning and face to face learning ? Give two references with your answer. How does online learning and face to face learning affects students around the world? Give two references with your answer.

Chapter 4 Solutions

C How To Program Plus Mylab Programming With Pearson Etext -- Access Card Package (8th Edition)

Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L