
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
- Write a java program called GradesAverage, which prompts user for the number of students, reads it from the keyboard, and saves it in an int variable called numStudents.
It then prompts user for the grades of each of the students and saves them in an int array called grades.
Your program shall check that the grade is between 0 and 100.
A sample session is as follow:
Enter the number of students: 3
Enter the grade for student 1: 55
Enter the grade for student 2: 108
Invalid grade, try again...
Enter the grade for student 2: 56
Enter the grade for student 3: 57
The average is 56.0
![Final HW-Java2021.doc [Compatibility Mode] - Word (Product Activation Failed)
困
FILE
НОМЕ
INSERT
DESIGN
PAGE LAYOUT
REFERENCES
MAILINGS
REVIEW
VIEW
X Cut
A Find -
Courier New
14
-A A
Aa -
V AaE AaL AaBbCcl AaBbCcDd Aa AaBbCcI AaBbCI
Be Copy
Paste
aac Replace
A Select -
U - abe X, x
A - aby
1 Normal
1 No Spac.
B
I
T Heading 1 T Heading 2 T Heading 3 T Heading 4 T Heading 5
Format Painter
Clipboard
Font
Paragraph
Styles
Editing
2. Write a java program called GradesAverage, which prompts user
for the number of students, reads it from the keyboard, and saves it in
an int variable called numStudents.
It then prompts user for the grades of each of the students and saves
them in an int array called grades.
Your program shall check that the grade is between 0 and 100.
A sample session is as follow:
Enter the number of students: 3
Enter the grade for student 1: 55
Enter the grade for student 2: 108
Invalid grade, try again...|
PAGE 1 OF 12
338 WORDS
ENGLISH (UNITED STATES)
148%
10:57 PM
Ps
Pr
Ae
a 4) ENG
5/11/2021
近](https://content.bartleby.com/qna-images/question/65d38184-2aa0-487e-a52f-3e11bb7cffb6/c2e03ba7-109f-47c7-b066-796b26ae902f/5u21kw_thumbnail.png)
Transcribed Image Text:Final HW-Java2021.doc [Compatibility Mode] - Word (Product Activation Failed)
困
FILE
НОМЕ
INSERT
DESIGN
PAGE LAYOUT
REFERENCES
MAILINGS
REVIEW
VIEW
X Cut
A Find -
Courier New
14
-A A
Aa -
V AaE AaL AaBbCcl AaBbCcDd Aa AaBbCcI AaBbCI
Be Copy
Paste
aac Replace
A Select -
U - abe X, x
A - aby
1 Normal
1 No Spac.
B
I
T Heading 1 T Heading 2 T Heading 3 T Heading 4 T Heading 5
Format Painter
Clipboard
Font
Paragraph
Styles
Editing
2. Write a java program called GradesAverage, which prompts user
for the number of students, reads it from the keyboard, and saves it in
an int variable called numStudents.
It then prompts user for the grades of each of the students and saves
them in an int array called grades.
Your program shall check that the grade is between 0 and 100.
A sample session is as follow:
Enter the number of students: 3
Enter the grade for student 1: 55
Enter the grade for student 2: 108
Invalid grade, try again...|
PAGE 1 OF 12
338 WORDS
ENGLISH (UNITED STATES)
148%
10:57 PM
Ps
Pr
Ae
a 4) ENG
5/11/2021
近
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 3 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
- Create the following program to demonstrate working with arrays in java. Your company pays its sales staff on a commission basis. Each employee receives $500 per week plus 6.5% of their sales. For example, a salesperson who sells $10,000 worth of products will get a salary of 500 + (10000 * .065) or $1150 for that week. You are given the task of creating a program to allow a manager to enter in the sales for 10 employees. (Store them in an array of course.) Then it should display the 10 sales amounts, the 10 salaries for this pay period, and the average salary. (Hint: There are a couple ways to approach this one, here are two ideas: (1) You could create a second array for the salaries and load it at the same time as you gather and store the sales, then loop through the salaries one to find the average, and then you have all the pieces to print. (2) Another solution would be to take in the sales, and then calculate the salaries on the print (which means you don't have to store them in a…arrow_forwardWrite a java program that prompts user for 10 numbers of any type and stores them in an array. Then print the following: All the values in the array. The sum of all values in the array. The average of all values in the array. The largest value in the array. The smallest value in the array. All the positive numbers in array. All the negative numbers in array. All the odd numbers in array. All the even numbers in array.arrow_forwardI need help with making a Java program, the general class that will be called “Businesses”. This class must have the following methods: selectSalesTax() – This method will read in a file “stateTaxInfo.txt” that has the name of a state and the tax percentage (decimal form) for that state and save them to the given arrays. It will then print a menu for the user to choose the state that the business is in and set the variables to hold the values. getCustomerName() – This method will prompt the user for the name of the person using the program calcSalesTax() – This method will be sent a subtotal and calculate the sales tax outputReceipt() – This method will output a generic receipt as follows: Subtotal $37.50 Sales Tax $2.44 Total $39.94 outputMenu() - This…arrow_forward
- Write a java class method named countOccurences that returns the number of times a particular integer occurs in an array of integers. The integer and the array will both be parameters.arrow_forwardCreate a Java program that will perform the following statements.Perform the following items in a continuous manner. The code solution for the next item will be basedon the code performed on the previous item.1. Create an ArrayList named “apostles” and add the following names to it: Juan, Pedro, Lucas,Judas, Mateo, Marcos and Simon.2. Print the size of the ArrayList to the standard output before and after adding the names.3. Use two methods to print the names in standard output.a. Using For loopb. Using Iterator4. Add the name “Philip” at the end, and add the name “Thomas” between the two names “Juan”and “Pedro”.5. Remove the name “Judas” using its index position.6. Search the names “Marcos”, “James” and “Judas” in the ArrayList “apostles”This part will display the following:Does “apostles” contains Marcos? _______ (it will return a Boolean result)Does “apostles” contains James? _______Does “apostles” contains Judas? _______7. Sort the names of the ArrayList in alphabetical order.8.…arrow_forwardjava a. A method named contains exists that takes an array of Strings and a single String, in that order, as arguments and returns a boolean value that is true if the array contains the given String. Assume that an array of Strings named names is already declared and initialized. Call the method to see if the array contains the name "Fred", and save the result in a new variable named fredIsHere. b. Given a method named printMessage that takes a String argument and returns nothing, call the method to print out "I love Java!".arrow_forward
arrow_back_ios
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