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
den301095 [7]
3 years ago
15

Create a function named calculate_gpa that is given a grade_scale and a student (in that order). It calculates the overall gpa f

or that student. The student will be in the same format as the example student123 student.
Computers and Technology
1 answer:
elena-14-01-66 [18.8K]3 years ago
3 0

Answer:

import java.util.ArrayList;

import java.util.Scanner;

public class StudentGrade {

 

  public static void main(String[] args) {

      Scanner scan = new Scanner(System.in);

      ArrayList<String> nameList = new ArrayList<String>();

      double scores[][] = new double[5][4];

      for(int i=0; i<scores.length; i++){

          System.out.println("Enter Student "+(i+1)+" Name: ");

          nameList.add(scan.nextLine());

          System.out.println("Enter Student "+(i+1)+" scores: ");

          for(int j=0; j<scores[i].length; j++){

              scores[i][j] = scan.nextDouble();

          }

          scan.nextLine();

      }

      for(int i=0; i<nameList.size(); i++){

          System.out.println("Student "+(i+1)+" Information: ");

          System.out.println("Student Name: "+getName(i, nameList));

          double average = getAverage(scores, i);

          System.out.println("Student Average: "+average);

          System.out.println("Student Grade: "+getGrade(average));

      }

  }

  public static char getGrade(double average){

      char grades[] = {'A','B','C','D','F'};

      if(average >=90 && average<=100){

          return grades[0];

      }

      else if(average >=80 && average<90){

          return grades[1];

      }

      else if(average >=70 && average<80){

          return grades[2];

      }

      else if(average >=60 && average<70){

          return grades[3];

      }

      else {

          return grades[4];

      }

     

  }

  public static double getAverage(double scores[][], int index){

      double average = 0;

      double sum = 0;

      for(int i=0; i<scores[index].length; i++){

          sum = sum + scores[index][i];

      }

      average = sum / 4;

      return average;

  }  

  public static String getName(int index, ArrayList<String> namelist){

      return namelist.get(index);

  }

}

You might be interested in
Write multiple if statements. If car_year is 1969 or earlier, print "Few safety features." If 1970 or later, print "Probably has
Paladinen [302]

Answer:

This program is executed in Dev C++ using C++ as a programming language.

Explanation:

#include<iostream>

using namespace std;

int main()

{

int carModelNo;

cout<<"Enter Car Model Number  ";

cin>>carModelNo;

 

EnterAgain:

 if(carModelNo==1969)

{

 cout<<"Few safety features.";

}

else if(carModelNo==1979)

{

 cout<<"Probably has seat belts.";

}

else if(carModelNo==1999)

{

 cout<<"Probably has antilock brakes.";

}

else if(carModelNo==2000)

{

 cout<<"Probably has airbags.";

}

else

{

 "Car Model Information Currently not Available";

 cout<<"Please enter the car model such as 1969, 1979, 1999, or 2000  ";

 cin>>carModelNo;

 goto EnterAgain;

}

return 0;

}

3 0
3 years ago
Describe white blood cells you see at 10X?
Naddik [55]

Answer:

White blood cells are part of the body's immune system. They help the body fight infection and other diseases. Types of white blood cells are granulocytes (neutrophils, eosinophils, and basophils), monocytes, and lymphocytes (T cells and B cells). ... Also called leukocyte and WBC.

Explanation:

8 0
3 years ago
Why a management-focused program provides a more appropriate learning path for you than a program based heavily on technical con
AlekseyPX
The program makes more money
3 0
4 years ago
Write a function named hasFinalLetter that takes two parameters
krek1111 [17]

Answer:

66

Explanation:

gfgrgdgghegdgdggdgdgd

4 0
3 years ago
CAD helps professionals to _____. create a technical drawing give directions to a new location calculate the interest rate of a
Inessa [10]

CAD stands for Computer Aided Design.  This technology for design uses software to aid in technical drawings and models.

CAD helps professionals to create a technical drawing. CAD is mainly used by architects, engineers, drafters, artists.

3 0
3 years ago
Read 2 more answers
Other questions:
  • When converting old html code to xhtml, make sure to replace the ____ attribute with the background-color style?
    10·1 answer
  • What are motion graphics?
    9·1 answer
  • Identify the use of queue in the process of spooling output to a printer.
    15·1 answer
  • 1. when is it a good idea to use lossless compression
    8·1 answer
  • Which of the following is not considered a system component that can be found inside a computer? A-CPU B-RAM C-PCIe graphics ada
    6·1 answer
  • What column, row, and text formatting issues are important when designing tables and lists?
    9·1 answer
  • Keely has an automation tool in place that runs a number of different processes for her and has for the last two years. All of a
    8·1 answer
  • Can anyone help with this?​
    6·1 answer
  • What is the output?
    7·1 answer
  • Which statement about sample size is true?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!