Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question
100%
Exercise Three:
In this exercise, we are storing the user's test score. You need to know, how many test score you want to enter.
· Ask the user to enter the size of the array.
Input Validation: Don't make the array size zero, less than zero, and more than 5 (to keep the calculation simple). If the user enters wrong number, make him/her to enter again until he/she enters the acceptable number.
. Then ask the user to enter his/her test score.
Input Validation: User can't enter any score number less than O or greater than 100. If s/he enters, do not terminate the program. Ask the user to enter the number again until s/he gets it right. Hint: Feel free to combine one loop inside another loop.
• Print them out they he/she has entered. Do not include those numbers in the test score array that is less than 0 or greater than 100.
• Print them in reverse order (Note: you are not reversing the array, you are just printing them in reverse order)
• Create an array and store all his even number scores.
• Print the array (make sure you are not printing 0 value)
. Print the Sum of even numbers
. Print their average up two decimal points
• Number of even scores
• Create an array and store all his odd number scores.
• Print the array (do not print O values)
• print the Sum of odd numbers
• print their average up to 2 decimal points
- Number of odd scores
Hint: To create an array for the even score and odd score, be mindful about the fact that all the numbers can be even in an array, or all the numbers can be odd in an array. Pick the same size. Do not assume, half of the numbers are going to be even, and
rest half are going to be odd.
Sample Output:
Please enter a number between 1 to 5: -5
Please enter a number between 1 to 5: 9
Please enter a number between 1 to 5: 5
Enter your i Score (1-100) : 200
Enter your 1 Score (1-100): 50
Enter your 2 Score (1-100) : 45
Enter your 3 Score (1-100) : -10
Enter your 3 Score (1-100) : 10
Enter your 4 Score (1-100) : 95
Enter your 5 Score (1-100): 80
Array the way user entered: 50 45 10 95 80
Array in reverse order :80 95 10 45 50
Finding Even scores in the array entered by the user!
Even Scores Array: 50 10 80
Sum of Even scores array: 140
Average of Even scores Array: 46.67
Number of Even scores in the Array: 3
Finding Odd scores in the array entered by the user!
Odd scores array: 45 95
Sum of Odd scores array: 140
Average of Odd scores array: 70.00
Number of Odd scores in the Array: 2
expand button
Transcribed Image Text:Exercise Three: In this exercise, we are storing the user's test score. You need to know, how many test score you want to enter. · Ask the user to enter the size of the array. Input Validation: Don't make the array size zero, less than zero, and more than 5 (to keep the calculation simple). If the user enters wrong number, make him/her to enter again until he/she enters the acceptable number. . Then ask the user to enter his/her test score. Input Validation: User can't enter any score number less than O or greater than 100. If s/he enters, do not terminate the program. Ask the user to enter the number again until s/he gets it right. Hint: Feel free to combine one loop inside another loop. • Print them out they he/she has entered. Do not include those numbers in the test score array that is less than 0 or greater than 100. • Print them in reverse order (Note: you are not reversing the array, you are just printing them in reverse order) • Create an array and store all his even number scores. • Print the array (make sure you are not printing 0 value) . Print the Sum of even numbers . Print their average up two decimal points • Number of even scores • Create an array and store all his odd number scores. • Print the array (do not print O values) • print the Sum of odd numbers • print their average up to 2 decimal points - Number of odd scores Hint: To create an array for the even score and odd score, be mindful about the fact that all the numbers can be even in an array, or all the numbers can be odd in an array. Pick the same size. Do not assume, half of the numbers are going to be even, and rest half are going to be odd. Sample Output: Please enter a number between 1 to 5: -5 Please enter a number between 1 to 5: 9 Please enter a number between 1 to 5: 5 Enter your i Score (1-100) : 200 Enter your 1 Score (1-100): 50 Enter your 2 Score (1-100) : 45 Enter your 3 Score (1-100) : -10 Enter your 3 Score (1-100) : 10 Enter your 4 Score (1-100) : 95 Enter your 5 Score (1-100): 80 Array the way user entered: 50 45 10 95 80 Array in reverse order :80 95 10 45 50 Finding Even scores in the array entered by the user! Even Scores Array: 50 10 80 Sum of Even scores array: 140 Average of Even scores Array: 46.67 Number of Even scores in the Array: 3 Finding Odd scores in the array entered by the user! Odd scores array: 45 95 Sum of Odd scores array: 140 Average of Odd scores array: 70.00 Number of Odd scores in the Array: 2
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education