
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
thumb_up100%

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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

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
- The value for pi can be approximated with the following sequence: 4 – 4/3 + 4/5 – 4/7 + 4/9 Write a Windows Forms Application that prompts the user for a number of terms and CALCULATES the value of the sequence for the specified number of terms; include a screenshot of your program running with successful outputarrow_forward_name_ is not definedarrow_forwardThe options for b is 108,5001,78, 99- choose one The options for a is 99,78,120, none-choose one for the above questionarrow_forward
- There are three seating categories at a high school athletic stadium. For a baseball game, Class A seats cost $15 each, Class B seats cost $12 each, and Class C seats cost $9 each. Create an application that allows the user to enter the number of tickets sold for each class. The application should be able to display the amount of income generated from each class of ticket sales and the total revenue generated. If the user fails to enter numeric values, display an appropriate error message and do not attempt to perform calculations Use the following test data to determine if the application is calculating properly:Ticket Sales RevenueClass A: 320 Class A: $4800.00Class B: 570 Class B: $6840.00Class C: 890 Class C: $8010.00Total Revenue: $19650.00Class A: 500 Class A: $7500.00Class B: 750 Class B: $9000.00Class C: 1200 Class C: $10800.00Total Revenue: $27300.00Class A: 100 Class A: $1500.00Class B: 300 Class B: $3600.00Class C: 500 Class C: $4500.00Total Revenue: $9600.00arrow_forwardAn alert box displays how many button. O it display two buttons An alert box displays only one button which is the Confirm button. one OK buttonarrow_forwardquestion 10arrow_forward
- Question 17 Choose the right answer properlyarrow_forwardThe function displays the highest value in a range.arrow_forwardEntering -1 without any numbers: Requirements: - Enter -1 to terminate enter numbers. You have to enter 3, or more, nonnegative numbers. Enter a number: -1 Good-bye! Entering an invalid number: Requirements: Enter -1 to terminate enter numbers. You have to enter 3, or more, nonnegative numbers. Enter a number: -4 Sorry, invalid number entered. Numbers must be nonnegative values. Enter another number: Entering less than 3 numbers: Requirements: - Enter -1 to terminate enter numbers. - You have to enter 3, or more, nonnegative numbers. Enter a number: 30 Enter another number: 2 Enter another number: -1 Sorry, you didn't enter the required nonnegative numbers for processing. Good-bye! Entering the required numbers: Requirements: - Enter -1 to terminate enter numbers. You have to enter 3, or more, nonnegative numbers. Enter a number: 60 Enter another number: 30 Enter another number: 50 Enter another number: 90 Enter another number: 5 Enter another number: -1 Lowest: 5 Highest: 90 Average:…arrow_forward
- Select the if statement that assigns .2 to commissionRate if the monthlySales is greater than 10000. if monthlySales > 10000: .2 = commissionRate if monthlySales > 10000: commissionRate if monthlySales > 10000 commissionRate .2 if monthlySales > 10000: commissionRate == .2arrow_forwardWhen expressed in proper scientific notation the number 0.00364 is ___. Please use ^ to indicate a power of 10, if necessary.arrow_forwardBoxPlots are centric to : (Select one) a) mean b) median c) mode d) Q1arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education