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, 22.06.2019 02:00
Think about some of the most memorable and forgettable games ever created. they can be games that were discussed in this unit or otherwise. what are some of the consistent factors that made certain games memorable to you? what were some of the consistent factors that made certain games forgettable to you? why? explain.
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
The "instance" relationship shows that something is an object of a
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
Alex’s family members live in different parts of the world. they would like to discuss the wedding plans of one of their distant relatives. however, alex wants all the family members to talk to each other simultaneously so that they can make decisions quickly. which mode of internet communication should they use? a. blog b. email c. wiki d. message board e. instant messaging
Answers: 2
question
Computers and Technology, 24.06.2019 02:00
Which steps will open the system so that you can enter a question and do a search for
Answers: 1
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
History, 03.08.2020 14:01
question
History, 03.08.2020 14:01
question
Mathematics, 03.08.2020 14:01
question
Social Studies, 03.08.2020 14:01
Questions on the website: 13722367