subject

You are given a program that prompts a user for 3 scores and then outputs the average of the scores. your task is to use java and modify the program as follows the program should:

read a user's first and last name
read three integer scores, calculate the total and average
determine the letter grade based on the following criteria - Average 90-100 grade is A, 80-89.99 grade is B, 70-79.99 grade is C, all others F (use a nested if)
Output formatted results consisting of the full name, the three scores, the total, average (to 2 decimal places), and the letter grade
go to step 1 if user wants to go through the above 4 steps for another student
You are required to use a method for each of the steps 1-4

you are required to use a while loop and a nested if in this program in addition to working with methods

code:

package assignment1;
import java. util. Scanner;

public class Assignment1 {

public static void main(String[] args) {
// declare scanner inputs for string and input
Scanner input = new Scanner (System. in);

//declare variables for program
String FirstName, LastName;
int score1, score2, score3;
double total, average;

//get output and input statements for first and last name
System. out. print("Please enter your first name: ");
FirstName = input. nextLine();
System. out. print("Please enter you last name: ");
LastName = input. nextLine();

//re-iterate the first and last name
System. out. print("your name is: " + FirstName + " " + LastName +
"\n\n");

//get input for test scores
System. out. print("Please enter test score 1: ");
score1 = input. nextInt();
System. out. print("Please enter test score 2: ");
score2 = input. nextInt();
System. out. print("Please enter test score 3: ");
score3 = input. nextInt();
System. out. print("\n\n");

//output 3 scores
System. out. println( FirstName + " " + LastName + "'s " + "scores are: "
+ score1 + " " + score2 + " " + score3 + "\n\n");

//set total equal to total of three scores
total = score1 + score2 + score3;

//output total scores, use printf for formatting
System. out. printf("%-10s%13.2f%n",
"the total of your 3 scores are: ", total);

//get average of test scores, use printf for formatting
average = (score1 + score2 + score3)/(3);
System. out. printf("%-10s%10.2f%n", "the average of your 3 scores are: "
, average);

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 13:00
Why should you evaluate trends when thinking about a career path?
Answers: 1
question
Computers and Technology, 24.06.2019 14:30
Two students are discussing electricity that has a frequency of 60 hz. student a says that this type of electricity is referred to as ac. student b says that in this type of electricity, the electrons flow in only one direction. which of the following statements is correct? a. only student a is correct b. only student b is correct c. both of the two students are correct d. neither of the two students is correct
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
To fill (copy) a cell across or down, point to the of the cell and drag. top left corner top right corner bottom left corner bottom right corner
Answers: 3
question
Computers and Technology, 24.06.2019 18:50
Which style did jack use on the vocabulary words in reports?
Answers: 2
You know the right answer?
You are given a program that prompts a user for 3 scores and then outputs the average of the scores....
Questions
question
Mathematics, 24.06.2019 13:00
question
English, 24.06.2019 13:00
question
Mathematics, 24.06.2019 13:00
Questions on the website: 13722363