Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

double totalscore = 0,avg; int score,count = 0; String grade; while(inF.hasNextInt()) { score= inF.nextInt(); if(vaildScore(score)) { grade = letterGrade(score); System.out.printf(%d %s %n,score,grade); totalscore += score;

image text in transcribed

image text in transcribed

image text in transcribed

double totalscore = 0,avg; int score,count = 0; String grade; while(inF.hasNextInt()) {

score= inF.nextInt(); if(vaildScore(score)) { grade = letterGrade(score); System.out.printf("%d %s %n",score,grade); totalscore += score; count++; }

else { System.out.printf("%d Invaild score%n",score); } } inF.close(); avg= totalscore/ count; System.out.printf("Average: %.2f, Letter Grade: %s %n",avg , letterGrade(avg)); System.out.printf("%nEnd of Program%n");

}

static boolean vaildScore(double score) { if (score 100) return false;

else return true; }

static String letterGrade(double score) { if(score >= 90) return "A"; else if(score >= 80) return "B"; else if(score >= 70) return "C"; else if(score >= 60) return "D"; else return "F"; } }

Note: there are 58 Sample Output and - in the header. **Lab 10 Fall 2018

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

recognize measures of patient safety, AppendixLO1

Answered: 1 week ago

Question

How well do you manage the difficult members of a group?

Answered: 1 week ago

Question

What are your key strengths as a trainer?

Answered: 1 week ago

Question

What do you find difficult in running a training session?

Answered: 1 week ago