C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 16, Problem 20PE
Program Plan Intro
Program plan:
- The two-dimensional array names of type char is used to hold 10 names.
- The array score1 of type int is used to hold scores of first test.
- The array score2 of type int is used to hold scores of second test.
- The array score3 of type int is used to hold scores of third test.
- The array score4 of type int is used to hold scores of fourth test.
- The array score5 of type int is used to hold scores of fifth test.
- The array avg of type float is used to hold average of all the 5 scores of 10 students.
- The array grade of type char is used to hold the grades of 10 students.
- A for loop is used to calculate sum of all the scores of 10 students.
- Another for loop is used to calculate average and corresponding grade of 10 students.
- Another for loop is used to display the name and grade of 10 students.
Program description:
The main purpose of the program is to calculate the grade of 10 students and display them in ascending order of their names.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Student Registration System is an approach that enables colleges and universities to better supervise a growing number of enrollments. Create a menu system for registration program in c++ that asking an input based on the choices below. If the input is A then the program will ask for name and program (course) store in two arrays, if B then the program will display all the data stored on the array and the program will be terminated only if the input is E.
Apply also function on the program:
Menu System – 1st Way of Function
Add Student – 4th Way of Function
Example:
REGISTRATION SYSTEM:
A - Add Student
B - View ALL
E - Exit
Choose: A
Name: John Lloyd
Program: CpE
REGISTRATION SYSTEM:
A - Add Student
B - View ALL
E - Exit
Choose: B
Name Program…
Student Registration System is an approach that enables colleges and universities to better supervise a growing number of enrollments. Create a menu system for registration program in c++ that asking an input based on the choices below. If the input is A then the program will ask for name and program (course) store in two arrays, if B then the program will display all the data stored on the array and the program will be terminated only if the input is E.
Apply also function on the program:
Menu System – 1st Way of Function
Add Student – 4th Way of Function
Example:
REGISTRATION SYSTEM:
A - Add Student
B - View ALL
E - Exit
Choose: A
Name: Sebastian
Program: CE
REGISTRATION SYSTEM:
A - Add Student
B - View ALL
E - Exit
Choose: B
Name Program
Carlo - CE
Sevi - CE
Language C++
Chapter 16 Solutions
C++ Programming: From Problem Analysis to Program Design
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Part3: Exercises Exercise 1: Write a Python program that inputs five positive integer numbers, finds their maximum and sort them in ascending order. Each number should be a distinct number (i.e. all numbers are different). Each number should be input and returned by a function named getValue(.) that receives a prompt message. A second function ascSortNumbers(..) should sort numbers and display them on screen in ascending order. A third function maxNumber(.) should receive five numbers as parameters and returns the maximum number to the function main..), which then prints the maximum number. Please input 5 numbers: 30 30 20 10 56 Invalid input, try again Please input 5 numbers: -9 67 20 10 97 Invalid input, try again Please input 5 numbers: 17 158 98 2 Sorted: 2 8 15 17 98 Maximum is: 98 Activate Window Go to Settings to activ Figure 1. Exercise 1 Sample Run.arrow_forwardIn C++, please and thank you!arrow_forward2. Test Scores File: test_scores.py Write pseudocode for the main() part of a program that asks the user to enter 4 test scores between 0 and 100, then displays a JCU grade for each score and also the average test score. When you have written the pseudocode for main, implement your solution in Python code and test it with a range of meaningful data. Remember that we've done the JCU grades question before, so copy your function from that practical code file. Sample Output Score: 3 Score: 50.5 Score: 66 Score: 100 Score 3.0, which is N Score 50.5, which is P Score 66.0, which is C Score 100.0, which is HD The average score was 54.875 Enhancements When you have that working... We asked for 4 scores. Have a look at your code... did you use 4 as a numeric literal or a constant?Change 4 to 3... Did you have to change the program in more than one place?If so, then you've missed one of the things we've taught...As a strong guideline: if you need to use the same literal more than once, you…arrow_forward
- Instructions Write a program in C++ that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and the highest and lowest temperatures for the year. Your program must consist of the following functions: Function getData: This function reads and stores data in the two-dimensional array. Function averageHigh: This function calculates and returns the average high temperature for the year. Function averageLow: This function calculates and returns the average low temperature for the year. Function indexHighTemp: This function returns the index of the highest high temperature in the array. Function indexLowTemp: This function returns the index of the lowest low temperature in the array. These functions must all have the appropriate parameters. An example of the program is shown below: Enter high temperature for each month 60 68 72 72 73 76 80 81 75 72 67 66 Enter low temperature for…arrow_forwardIn C++ please Write a program to simulate a pick-5 lottery game. Your program should generate and store 5 distinct numbers between 1 and 9 (inclusive) into an array. The program prompts the user to enter five distinct between 1 and 9 and stores the number into another array. The program then compares and determines whether the two arrays are identical. If the two arrays are identical, then the user wins the game; otherwise the program outputs the number of matching digits and their position in the array. Your program must contain a function that randomly generates the pick-5 lottery numbers. Also, in your program, include the function sequential search to determine if a lottery number generated has already been generated.arrow_forwardPrograming in C Write a program that calculates the average grade of a class. 1. You should ask the user how many students you have (you will use this number to set up the length of your array of decimals). 2. Once you have your array, you will have to ask the user for all the grades (there should only be one grade per student). Using a while loop. 3. While you are scanning the grades, you should check if the inputted grade is in the range 0.0 to 10.0 (inclusive). If the grade is not in this range, you should display a message to the user and assign 0.0 to the grade. 4. Once your array is populated with all student's grades, print out the values of the array, so that the user knows these values were saved correctly (use a while loop as well). 5. After this calculate the average (add up all grades and divide by the number of students). Hint: You will need a loop to do so; please use a while loop as well. Example: How many students are in your class? 8 Please input the grades: 8.5 9.8…arrow_forward
- in c++ Create a function that takes in a size and creates an array in the function of that size. The array should only contain even numbers. Return the array to main and show how that is done.arrow_forwardin C language pweasearrow_forward1. Write a program (C++) and algorithm that will calculate the average of test scores. It will ask the user for number of students and the number of test scores per student. 2. Create a program (C++) and algorithm that uses an array to store the results from a poll of 25 people. Each person was asked to estimate the amount of time, in minutes, that he or she spends on Facebook each day. The program should allow the user to enter a specific number of minutes and then display the number of people spending more than that length of time.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning