Question
Java please
9:55 Note @13 simple lists of numbers. If the user selects option 2, your program should prompt for a list of integer grades
10:04 1 Note @13 Notes Note that the list is completed when a grade is entered that is out of range, (like -1) . If the list
0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you have any doubts, please give me comment...

import java.util.Scanner;

public class GradeStats{

public static void main(String[] args) {

Scanner in = new Scanner(System.in);

int no_A=0, no_B =0, no_C =0, no_D = 0, no_F=0;

System.out.println("Please enter a list of grades(0-100) :");

int grade = in.nextInt();

int n =0, highest = 0, lowest = 100;

double avg = 0.0;

while(grade!=-1){

n++;

if(grade>=90)

no_A++;

else if(grade>80)

no_B++;

else if(grade>70)

no_C++;

else if(grade>60)

no_D++;

else

no_F++;

if(highest<grade)

highest = grade;

if(lowest>grade)

lowest = grade;

avg += grade;

grade = in.nextInt();

}

avg /= n;

System.out.println("Total number of grades = "+n);

System.out.println("Number of A's = "+no_A+" ("+((no_A/(double)n)*100)+"%)");

System.out.println("Number of B's = "+no_B+" ("+((no_B/(double)n)*100)+"%)");

System.out.println("Number of C's = "+no_C+" ("+((no_C/(double)n)*100)+"%)");

System.out.println("Number of D's = "+no_D+" ("+((no_D/(double)n)*100)+"%)");

System.out.println("Number of F's = "+no_F+" ("+((no_F/(double)n)*100)+"%)");

System.out.println("Highest grade = "+highest);

System.out.println("Lowest grade = "+lowest);

System.out.println("Class average = "+avg);

}

}

nagaraju@nagaraju-Vostro-3550:~/Desktop/CHEGG/2019/February/04022019$ javac Gradestats.java nagaraju@nagaraju-Vostro-3550:~/D

Add a comment
Know the answer?
Add Answer to:
Java please 9:55 Note @13 simple lists of numbers. If the user selects option 2, your...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PLEASE DO THIS IN C#.Design and implement a program (name it ProcessGrades) that reads from the...

    PLEASE DO THIS IN C#.Design and implement a program (name it ProcessGrades) that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below. Sample run 1: You entered: 95, 80, 100, 70 Highest grade: 100 Lowest grade: 70 Average grade: 86.25

  • Java Program: In this project, you will write a program called GradeCalculator that will calculate the...

    Java Program: In this project, you will write a program called GradeCalculator that will calculate the grading statistics of a desired number of students. Your program should start out by prompting the user to enter the number of students in the classroom and the number of exam scores. Your program then prompts for each student’s name and the scores for each exam. The exam scores should be entered as a sequence of numbers separated by blank space. Your program will...

  • using java Program: Please read the complete prompt before going into coding. Write a program that...

    using java Program: Please read the complete prompt before going into coding. Write a program that handles the gradebook for the instructor. You must use a 2D array when storing the gradebook. The student ID as well as all grades should be of type int. To make the test process easy, generate the grade with random numbers. For this purpose, create a method that asks the user to enter how many students there are in the classroom. Then, in each...

  • IN JAVA WITH COMMENTS, The assignment: This program inputs the names of 5 students and the...

    IN JAVA WITH COMMENTS, The assignment: This program inputs the names of 5 students and the (integer) grades they earned in 3 tests. It then outputs the average grade for each student. It also outputs the highest grade a student earned in each test, and the average of all grades in each test. Your output should look like this: Mary's average grade was 78.8% Harry's average grade was 67.7% etc... : In test 1 the highest grade was 93% and...

  • I need help regarding my Visual Basic code ISC/ITE 285 Homework Due: Monday, January 28 by...

    I need help regarding my Visual Basic code ISC/ITE 285 Homework Due: Monday, January 28 by 11:55 pm Create a text file named "Grades.txt" which will contain a list of numeric grades. Save the file in the projects Bin/Debug folder. A sample of the file contents is shown below: 80 96 95 86 54 97 Create a string array that will be populated from the file "Grades.txt" when the array is created (Class-level array). Also create a numeric array that...

  • Java Question Method and 1 dimension arrays (20) YouTube ㄨ Electronics, Cars, Fashion, Co × Upload...

    Java Question Method and 1 dimension arrays (20) YouTube ㄨ Electronics, Cars, Fashion, Co × Upload Assignment: Program xy 9 Program3.pdf eduardo C Secure https://blackboard.kean.edu/bbcswebdav/pid-736390-dt-content-rid-2804166 1/courses/18SP CPS 2231 06/Program3.pdf Concepts: Methods and one dimensional Arrays Point value: 45 points Write a Java Class that reads students grades and assigns grades based on the following grading "curve .Grade is A if the score is greater than or equal to the highest score - 10 .Grade is B if the score is...

  • [JAVA/chapter 7] Assignment: Write a program to process scores for a set of students. Arrays and...

    [JAVA/chapter 7] Assignment: Write a program to process scores for a set of students. Arrays and methods must be used for this program. Process: •Read the number of students in a class. Make sure that the user enters 1 or more students. •Create an array with the number of students entered by the user. •Then, read the name and the test score for each student. •Calculate the best or highest score. •Then, Calculate letter grades based on the following criteria:...

  • [15 marks] Suppose that students enrolled in one course are required to take four tests, and...

    [15 marks] Suppose that students enrolled in one course are required to take four tests, and each student’s final grade for this course is the average of his/her grades of these four tests. This question asks you to write a program that can be used to compute the lowest final grade, highest final grade and the average final grade. General Requirements: Use a5q1.c as the name of your C source code file. We will use the following command on bluenose...

  • Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate...

    Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate the number of test scores the user enters; have scores fall into a normal distribution for grades -Display all of the generated scores - no more than 10 per line -Calculate and display the average of all scores -Find and display the number of scores above the overall average (previous output) -Find and display the letter grade that corresponds to the average above (overall...

  • Python Help Please Problem 4-4: Make a list of 20 numbers and place them in a...

    Python Help Please Problem 4-4: Make a list of 20 numbers and place them in a random order (don't arrange them in ascending or descending order - make sure the list is truly random). Calculate and print out the largest number in the list and the lowest number in the list. Problem 4-5: Make a list of multiples of 5 between 1 and 100. Once you have your list, print it out. Problem 4-6: Generate a list of values from...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT