/* Problem 1 Write a Java program using a while loop that accomplishes the following: 1) The program asks the student to enter his/her name and grades for classes taken. The student must enter grades for at least five classes. The grade must be between 0 and 100. 2) Prompt the user to enter a sentinel value of -1 to stop the user from continuing to enter grades. 3) The program determines which student has passed the exam. The passing score is 75 and above. 4) The program prints out the names of students and the score entered for each student. 5) The program counts and prints out the number of students that entered their scores. 6) The program counts and prints out the number of students that passed the exam. 7) The program calculates the % of students that passed the exam.
Added by Beatriz L.
Close
Step 1
To do this, we can use a while loop to repeatedly ask the user for input until they have entered grades for at least five classes. We can use a counter variable to keep track of the number of grades entered. Here's the code for this step: ```java import Show more…
Show all steps
Your feedback will help us improve your experience
Jennifer Stoner and 69 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a Java program to calculate student's final course grade. The program should: (1) Prompt and read user's input for the student's name, assignment 1 grade (A1), assignment 2 grade (A2), exam grade (EX), and participation grade (P). User Scanner to read input. (2) Each grade input should be 0-100 and the final grade should be calculated as follows: A1*0.25+A2*0.25+EX*0.4+P*0.1 (3) Output the student's information and the calculated course grade (4) prompt user whether they want to calculate grade for another student and repeat the input/output processing (5) Allow user to exit program without inputting student's data.
Akash M.
Write a Java program to input marks of 3 subjects of a student and print his total and average. Declare him 'passed' if his average is 40 or above; otherwise, declare him 'failed'.
Shelayah R.
Design a program using a console application in Java, named StudentMarksReport, that will print the final result obtained by a student with the weighting of each module. Make use of a class named Student that contains variables to store the student number, test result, assignment result, and exam result. Create a constructor that accepts the student number, test result, assignment result, and the exam result as parameters and create get methods for the variables (Use Scanner to get variables from the user). Create a subclass called StudentReport that extends the Student class. The StudentReport overrides all getter methods and the constructor from Students. Write code for the printReport method which calculates each assessment weighting as follows: Assessment Weighting Test 25% Assignment 25% Exam 50%
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD