Question

Create a grading system using java? Below 74 = 5.0 75 - 79 = 4.5 80...

Create a grading system using java?

Below 74 = 5.0
75 - 79 = 4.5
80 - 84 = 4
85 - 89 = 3
90 - 93 = 3.5
94 - 95 = 2
96 - 97 = 1.5
98 - 100 = 1

0 0
Add a comment Improve this question Transcribed image text
Answer #1

import java.util.Scanner;

class Main {

public static double getGrade(int score)

{

if(score >= 98)

return 1;

if(score >= 96)

return 1.5;

if(score >= 94)

return 2;

if(score >= 90)

return 2.5;

if(score >= 85)

return 3;

if(score >= 80)

return 4;

if(score >= 75)

return 4.5;

return 5.0;

}

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

System.out.print("Enter score: ");

int s = sc.nextInt();

System.out.print("Grade is " + getGrade(s));

}

}

/*SAMPLE OUTPUT

Enter score: 95

Grade is 2.0

*/

Add a comment
Know the answer?
Add Answer to:
Create a grading system using java? Below 74 = 5.0 75 - 79 = 4.5 80...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Midterm1 = (83.33, 98.33, 75, 91.67, 96.67, 95, 86.67, 65, 100, 100, 80, 88.33, 96.67, 96.67,...

    Midterm1 = (83.33, 98.33, 75, 91.67, 96.67, 95, 86.67, 65, 100, 100, 80, 88.33, 96.67, 96.67, 90, 96.67, 86.67, 93.33, 80, 91.67, 98.33, 86.67, 85, 86.67, 95, 83.33, 96.67, 81.67, 98.33, 100, 95, 93.33, 91.67, 88.33, 98.33, 93.33, 98.33, 93.33, 85, 88.33, 100, 98.33, 96.67, 90, 86.67, 100, 96.67, 98.33, 90, 96.67, 86.67, 95, 78.33, 86.67, 100, 81.67, 96.67, 91.67, 96.67, 96.67, 95, 96.67, 73.33, 100, 93.33, 96.67, 88.33, 70, 96.67, 96.67, 100, 88.33, 96.67, 100, 88.33, 100, 78.33, 93.33,...

  • 5. Mark’s class just took the admission test for business school and averaged 87.05. Chapter 10...

    5. Mark’s class just took the admission test for business school and averaged 87.05. Chapter 10 Data Set 2 contains the population of scores for the 10 other classes in Mark’s university. How did Mark’s class do? Class 1 Class 2 Class 3 Class 4 Class 5 Class 6 Class 7 Class 8 Class 9 Class 10 78 81 96 85 88 78 90 79 96 86 77 78 97 90 88 82 86 93 87 89 78 93 88...

  • 1. On the following page are the exam scores on the first Statistics test for all...

    1. On the following page are the exam scores on the first Statistics test for all my classes. Using everything we covered in the first three chapters of our textbook, describe the data. I recommend going through your notes and textbook, chapter by chapter. Include as much as you can – type of data, frequency distribution, histogram, numerical methods, etc. The standard deviation for the data is 16.7. Exam Scores on the First Statistics Test 100 88 100 86 100...

  • Consider the below matrixA, which you can copy and paste directly into Matlab.

    Problem #1: Consider the below matrix A, which you can copy and paste directly into Matlab. The matrix contains 3 columns. The first column consists of Test #1 marks, the second column is Test # 2 marks, and the third column is final exam marks for a large linear algebra course. Each row represents a particular student.A = [36 45 75 81 59 73 77 73 73 65 72 78 65 55 83 73 57 78 84 31 60 83...

  • PLEASE SHOW ME HOW TO DO THIS.... For the Excel Data Set please find and report...

    PLEASE SHOW ME HOW TO DO THIS.... For the Excel Data Set please find and report for Test 1 and Test 2 the Mean, SD, and the tolerance levels for both for which there would be any outliers (i.e., the value for which a score must be less than to be consider an outlier and the value for which a number must greater than to be considered an outlier. See picture Performance Data Group 1 1 1 1 Test 2...

  • An article of the American Journal of Clinical Pathology, by Metz et al. (A-4) published the...

    An article of the American Journal of Clinical Pathology, by Metz et al. (A-4) published the comparison of three methods to determine the percentage of dysmorphic erythrocytes in the urine. They obtained the following results when using the A (X) and B (Y) methods in 75 urine samples. Draw a scatter diagram and obtain the regression equation and graph it on the diagram. X            Y            X            Y            X            Y            X            Y 0            0            20          16          65          55          89          81 0           ...

  • Use the Grouped Distribution method for the following exercise (see Self-Test 2-4 for detailed instructions), rounding...

    Use the Grouped Distribution method for the following exercise (see Self-Test 2-4 for detailed instructions), rounding each answer to the nearest whole number. Using the frequency distribution below (scores on a statistics exam taken by 80 students), determine:ion 1 of the preliminary test (scores on a statistics exam taken by 80 students), determine: 68 84 75 82 68 90 62 88 76 93 73 79 88 73 60 93 71 59 85 75 61 65 75 87 74 62 95...

  • Use the Grouped Distribution method for the following exercise (see Self-Test 2-4 for detailed instructions), rounding...

    Use the Grouped Distribution method for the following exercise (see Self-Test 2-4 for detailed instructions), rounding each answer to the nearest whole number. Using the frequency distribution below (scores on a statistics exam taken by 80 students), determine:ion 1 of the preliminary test (scores on a statistics exam taken by 80 students), determine: 68 84 75 82 68 90 62 88 76 93 73 79 88 73 60 93 71 59 85 75 61 65 75 87 74 62 95...

  • Microsoft Excel Question. I'm having trouble using the vlookup function, I have calculated a final numerical...

    Microsoft Excel Question. I'm having trouble using the vlookup function, I have calculated a final numerical grade for a hypothetical course, and and trying to use a set of numerical grades with their corresponding letter grades to get a vlookup function to return the letter grade from the numerical grade. However the function for some reason only returns the lowest value out of the set grades, not the closest match. Projects Classwork Teamwork/Integrity 100 100 A+ 98 A+ 97 A...

  • 1.         For each set below, using Excel, construct            a.         a frequency distribution,   ...

    1.         For each set below, using Excel, construct            a.         a frequency distribution,    b.         a relative frequency distribution, and            c.         a cumulative relative frequency distribution. Consider whether or not you should group your data. Describe how you determined your bin width, if you grouped the data in intervals. Set 1 75    95    103 100 93 91 90 92 89 105 86 85 81 96 103 99 94 95 91 97 92 107...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT