1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
melamori03 [73]
2 years ago
8

Write a method named printGPA that takes in as a parameter a Scanner to read in user input, and calculates a student's grade poi

nt average. The user will type in input containing the student's name, then a number of scores, followed by that many integer scores. Then, the method will print out the average of all grades entered. Here are two example dialogues: Enter a student name: Maria Enter the number of courses: 5 Course 1 Grade: 72 Course 2 Grade: 91 Course 3 Grade: 84 Course 4 Grade: 89 Course 5 Grade: 78 Maria's grade is 82.8 Enter a student name: Jordan Enter the number of courses: 4 Course 1 Grade: 86 Course 2 Grade: 71 Course 3 Grade: 62 Course 4 Grade: 90 Jordan's grade is 77.25
Computers and Technology
1 answer:
KatRina [158]2 years ago
5 0

import java.util.Scanner;

public class JavaApplication40 {

   public static  void printGPA(Scanner scan){

       System.out.println("Enter a student name:");

       String name = scan.nextLine();

       System.out.println("Enter the number of courses:");

       int courses = scan.nextInt();

       double total = 0;

       for (int i = 1; i <= courses; i++){

           System.out.println("Course "+i+" Grade:");

           double grade = scan.nextDouble();

           total += grade;

       }

       System.out.println(name+"'s grade is "+(total/courses));

   }

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       printGPA(scan);

   }

   

}

I hope this helps!

You might be interested in
How many suggestions available in correcting misspelled words<br>​
Basile [38]

Spelling Checker, Grammarly, and there are many assets.

5 0
3 years ago
Select the correct answer. What is the purpose of preserving historical data? A. legal compliance B. recruitment C. leave sancti
Gre4nikov [31]

Answer:The main goal of data preservation is to protect data from being lost or destroyed and to contribute to the reuse and progression of the data.

Explanation:

8 0
2 years ago
Which function returns the least value of a given set of numbers or range of cells?
hoa [83]
Min()
This function will return the least value of a set of given numbers
6 0
3 years ago
How has the use of social media changed people's writing? A. It is now succinct and brief. B. It now contains longer words. C. I
Ainat [17]
A) It is now succinct and brief.
4 0
3 years ago
Read 2 more answers
The paint 3D program is used for drawing picture true or false​
hammer [34]

Answer:

The answer is TRUE we use paint program to draw.

Explanation:

#swag

3 0
3 years ago
Read 2 more answers
Other questions:
  • What are sums of money that are given out for specific reasons?
    5·2 answers
  • Write a function with two parameters, prefix (a string, using the string class from ) and levels (an unsigned integer). The func
    14·1 answer
  • A is a paid placement that appears in a search engines results page at or near the top of the results
    5·1 answer
  • A company wants a recruiting app that models candidates and interviews; displays the total number of interviews each candidate r
    6·1 answer
  • Which of the following changes would be LEAST LIKELY lead to economic growth in a country?
    12·1 answer
  • Dereck works for long hours on his computer. He frequently experiences physical strain by the end of the day because he does not
    8·2 answers
  • Suppose you were assigned to develop a logical model of the registration system at a school or college. Would you be better off
    12·1 answer
  • What can be the maximum possible length of an identifier 3163 79 can be of any length​
    5·1 answer
  • Consider the following method, which is intended to count the number of times the letter "A" appears in the string str.
    13·1 answer
  • You are configuring a network attached storage (nas) appliance. what file sharing protocol(s) could you use to allow access to w
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!