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
100 POINTS + BRAINLYEST TO FIRST PERSON THAT IS CORRECT!!! Which items can be found in the Properties section of the Backstage V
Lunna [17]

Print settings

author off document

how many times it has been viewed

4 0
2 years ago
Read 2 more answers
write query for all products reutrn product name with its amounts due, paid, canceled, and refunded, order the result by product
spayn [35]

Answer:

SELECT product_name, amount_due, amount_paid,

              cancelled, amount_refunded

   FROM products

ORDER BY product_name ASC;

Explanation:

SQL (Structured Query Language ) was used above.

The SELECT command is used to list all the variables we want in our output.

The FROM command signifies the location.

ORDER BY command ensures that your result is ordered

ASC means Ascending Order.

; signifies the end of the query.

NOTE: Underscores were used because variables cannot be written with spaces between them

8 0
2 years ago
The blank contains the computer's brain the central processing unit CPU
Mila [183]

The Motherboard contains the computer's brain which is the Central Processing Unit (CPU).  It is the main circuit board for the computer, containing both soldered, non removable components along with sockets or slots for components that can be removed. The motherboard holds the CPU, RAM and ROM chips, etc.

7 0
3 years ago
Which of the following networks had these two goals: a) allowing scientists to work together on scientific projects; and, b) fun
mrs_skeptik [129]

Answer:

ARPANET

Explanation:

It was the ARPANET sponsored by the US Department of Defense to enable scientists collaborate on research.

5 0
3 years ago
Read 2 more answers
In the 1960s, techniques were developed that allowed individuals to fool the phone system into providing free access to long dis
ycow [4]

Answer:

A

Explanation:

4 0
3 years ago
Other questions:
  • Text that has equal left and right margins is said to be
    14·2 answers
  • how to answer the questions on brainly? I've typed my answer in the box but there's no submit button or whatever, and the only t
    14·2 answers
  • What are the ethical implications of online social media after someone has died
    8·2 answers
  • What is the name of the virus that appears to be a legitimate program but when opened
    9·1 answer
  • Interactive sites where users write about personal topic and comment to threaded discussion are called?
    10·2 answers
  • Suppose L is a LIST and p, q, and r are positions. As a function of n, the length of list L, determine how many times the functi
    8·1 answer
  • What type of formula uses data from multiple worksheets
    6·1 answer
  • Write a function sumOfMultiples, that inputs two integers - seed and cap. The function should return the sum of all the multiple
    6·1 answer
  • . Why is it important to use Social Media responsibly? ANSWER NOW!!!
    15·2 answers
  • Which internet explorer security feature restricts the browsing session information that can be tracked by external third-party
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!