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 23:30
Creating "smart interfaces" in all sectors of industry, government, and the public arena is one of the fastest growing hct areas. these interfaces model, interpret, and analyze such human characteristics as speech, gesture, and vision. the field of biometrics, in which humans authenticate themselves to machines, is an area of considerable interest to hct practitioners. fingerprint scans are one of the most frequently used biometric options, and this article, biometric student identification: practical solutions for accountability & security in schools, makes a case for the implementation of fingerprint scans in schools. critique the article, and answer the following questions: according to the author, what are the main benefits of adopting fingerprint scans in schools for student identification? according to the author, what are the main drawbacks of adopting fingerprint scans in schools for student identification? do you agree with the author's assessment of the pl
Answers: 2
question
Computers and Technology, 23.06.2019 01:00
Let r be a robotic arm with a fixed base and seven links. the last joint of r is a prismatic joint, the other ones are revolute joints. give a set of parameters that determines a placement of r. what is the dimension of the configuration space resulting from your choice of parameters?
Answers: 3
question
Computers and Technology, 23.06.2019 02:00
Consider the following function main: int main() { int alpha[20]; int beta[20]; int matrix[10][4]; . . } a. write the definition of the function inputarray that prompts the user to input 20 numbers and stores the numbers into alpha. b. write the definition of the function doublearray that initializes the elements of beta to two times the corresponding elements in alpha. make sure that you prevent the function from modifying the elements of alpha. c. write the definition of the function copyalphabeta that stores alpha into the first five rows of matrix and beta into the last five rows of matrix. make sure that you prevent the function from modifying the elements of alpha and beta. d. write the definition of the function printarray that prints any onedimensional array of type int. print 15 elements per line. e. write a c11 program that tests the function main and the functions discussed in parts a through d. (add additional functions, such as printing a two-dimensional array, as needed.)
Answers: 3
question
Computers and Technology, 23.06.2019 16:50
15: 28read the summary of "an indian's view of indian affairs."15 betterin "an indian's view of indian affairs," it is asserted that conflicts could be reduced if white americansunderstood native americans..pswhich of the following would make this summary more complete? eleo the fact that chief joseph believes the great spirit sees everythinthe fact that chief joseph was born in oregon and is thirty-eight years oldo the fact that chief joseph states that he speaks from the hearthehehethe fact that chief joseph of the nez percé tribe made this claimebell- ==feetle===-felsefe ==submitmark this and retum.=
Answers: 3
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
Social Studies, 29.07.2019 09:20
question
Mathematics, 29.07.2019 09:20
Questions on the website: 13722365