Please enter a number between 1 to 5: -5 Please enter a number betveen 1 to 5: 9 Please enter a number between 1 to 5: 5 Enter your 1 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 180 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: 16.67 Mumber of Even scores in the Array: 3 Finding Odd acores in the array entered by the user! odd scores array: 15 95 Sum of odd scores array: 140 Average of odd scores array: 70.00 Number of Odd scores in the Array: 2

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
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
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Control Structure
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education