All input and output using Dialog boxes. Nothing on the command line. you will c
ID: 3632026 • Letter: A
Question
All input and output using Dialog boxes. Nothing on the command line.you will create a main method, a printGrades method, and a sumGrades method
printGrades method should print out the contents of an array of grades using ONE dialog box.
this method has one parameter, an array of ints
this method will print out the contents of the array of ints that is passed to it
print out the contents of the array of ints using ONE dialog box
each time you need to print the array of grades, call this method
the output should look like this
Grade 1 is __
Grade 2 is __
Grade 3 is __
etc
etc until
Grade x is __
x is the number of tests that the user entered
Remember to print all of the grades in ONE dialog box
sumGrades method
sumGrades has one parameter, an array of ints
this method will add the ints in the array
this method will return the sum of the ints
in the main method
ask the user how many tests she took
assign the input to a varible named numberOfTestsTaken of type int
print out "The number of tests taken is: ___
declare and create an array of integers called myGrades
the length of the myGrades array is equal to the number of tests that the user has given
call the printGrades method
At this point, the grades should be 0, because no grades have been entered by the user
using a for loop, ask the user to enter the grades
ask the user to enter as many grades as there are tests
as the user enters each grade, assign it to an element of the myGrades array
So prompt "Enter grade 1: "
Assign the integer entered by the user to myGrades[0];
prompt again: "Enter grade 2: "
Assign the integer entered by the user to myGrades[1];
and so on, until all the grades are entered and the array is full
call the printGrades method
call the sumGrades method to find out the sum of the grades
in main, print out the sum: "The sum of the grades is: ___"
Find the average of the grades in the array
The average is the sum of the grades divided by the number of tests
Print out the average: "The average grade is: ___"
Explanation / Answer
Write a class called HomeworkSeven that will
All input and output using Dialog boxes. Nothing on the command line.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.