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
Contact [7]
3 years ago
12

Create a method called letterGrade that will pass the student's average grade as a parameter and return a letter grade (char). O

nce passed, use an if..else if structure to determine whether the student has an A, B, C, D, or F. Return that letter grade. Use the standard grade scale: 90-100 (A), 80-89 (B), 70-79 (C), 60-69 (D), 0-59 (F).
Computers and Technology
1 answer:
Crank3 years ago
4 0

Answer:

The method in Java is as follows:

public static char letterGrade(int average){

    char grade =' ';

    if(average>= 90 && average <=100){ grade ='A'; }

    else if(average>= 80 && average <=89){ grade ='B'; }

    else if(average>= 70 && average <=79){ grade ='C'; }

    else if(average>= 60 && average <=69){ grade ='D'; }

    else if(average>= 0 && average <=59){ grade ='F'; }

    return grade;

}

Explanation:

This defines the method

public static char letterGrade(int average){

This initializes the grade to a blank

    char grade =' ';

If average is between 90 and 100 (inclusive), grade is A

<em>     if(average>= 90 && average <=100){ grade ='A'; }</em>

If average is between 80 and 89 (inclusive), grade is B

<em>     else if(average>= 80 && average <=89){ grade ='B'; }</em>

If average is between 70 and 79 (inclusive), grade is C

<em>     else if(average>= 70 && average <=79){ grade ='C'; }</em>

If average is between 60 and 69 (inclusive), grade is D

<em>     else if(average>= 60 && average <=69){ grade ='D'; }</em>

If average is between 0 and 59 (inclusive), grade is F

<em>     else if(average>= 0 && average <=59){ grade ='F'; }</em>

This returns the grade

    return grade;

}

You might be interested in
Explain the importance of calculating a robot’s ability to extend its arm
MArishka [77]

Answer:

robot's importance

Explanation:

An industrial robot is equipped with many metrological or measurable properties that directly influence the efficiency of the robot during its performance. Repetitiveness and accuracy are the main measurable features. In general, a robot's repetitiveness might be defined as its ability to perform the same task repeatedly. On the other hand, precision is the difference (i.e. the mistake) between the requested task and the achieved task. Its concepts are often confused in robotics when it comes to repeatability and accuracy.Therefore, repeatability is always doing the same thing, while accuracy always reaches your target.

7 0
3 years ago
How to connect two monitors for one desktop
Tems11 [23]

Answer:

two HDMI cords, this will help you your monitors

5 0
2 years ago
Read 2 more answers
The risk of carbon monoxide poisoning can be reduced by
lisov135 [29]
A machine. I foget the name but there can be a machine, or fresh air, or turning off your car, or opening doors and getting out when there;s a fire or smoke.
5 0
4 years ago
Ebay employs the _____ auction mechanism.
myrzilka [38]

Answer:

A. Foward

Explanation:

4 0
3 years ago
Read 2 more answers
Write a program that prompts the user to input five decimal numbers. The program should then add the five decimal numbers, conve
juin [17]

Answer:

#include <iostream>

#include <cmath>

using namespace std;

int main()

{

   double num1, num2, num3, num4, num5, sum = 0;

   cout << "Input: ";

   cin >> num1 >> num2 >> num3 >> num4 >> num5;

   

   sum = num1 + num2 + num3 + num4 + num5;

   cout << "Output: " << static_cast<int>(round(sum)) << endl;

   return 0;

}

Explanation:

Include cmath to use the round function

Declare the variables

Get the five numbers from the user

Sum them and assign the result to the sum

Round the sum using the round function, and convert the sum to an integer using static_cast statement

Print the sum

6 0
4 years ago
Other questions:
  • On an Android device, where can a user find the correct app to use to sync contacts and apps among devices?
    10·1 answer
  • Help!!!!!!!!!!!!!!!!!!!
    12·1 answer
  • Define data, explain its three forms, and the general steps a computer performs related to data.
    7·1 answer
  • Secops focuses on integrating the need for the development team to provide iterative and rapid improvement to system functionali
    14·1 answer
  • Design a Ship class with the following members:
    13·1 answer
  • Question 2Write a MIPS assembly implementation of the following C/C++ code. Assume small, unsigned integer arithmetic (no range
    10·1 answer
  • Tightly.
    5·1 answer
  • In my mouth In my hair..........​
    15·2 answers
  • Any movie/show suggestions??
    7·2 answers
  • What methods could you use to set up printing in an organization?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!