### Round the average score to one decimal

Assignment Help JAVA Programming
##### Reference no: EM13941515

The number format in one decimal place to make this to round the average score to one decimal in this program.

////////////////////////////////////////////////

import java.util.Scanner;

public class TestScoreApp
{
public static void main(String[] args)
{
// display operational messages
System.out.println("Please enter test scores that range from 0 to 100.");
System.out.println("To end the program enter 999.");
System.out.println(); // print a blank line

// initialize variables and create a Scanner object
double scoreTotal = 0;
int scoreCount = 0;
int testScore = 0;
Scanner sc = new Scanner(System.in);

// get a series of test scores from the user
while (testScore <= 100)
{
// get the input from the user
System.out.print("Enter score: ");
testScore = sc.nextInt();

// accumulate score count and score total
if (testScore <= 100)
{
scoreCount = scoreCount + 1;
scoreTotal = scoreTotal + testScore;
}
}

// display the score count, score total, and average score
double averageScore = scoreTotal / scoreCount;
String message = "n" +
"Score count: " + scoreCount + "n"
+ "Score total: " + scoreTotal + "n"
+ "Average score: " + averageScore + "n";
System.out.println(message);
}
}

### Write a Review

#### Write a program that will calculate monthly pay

Write a program that will calculate monthly pay and expenses for a commercial utility sales person. Sales employees in this company are paid monthly. Each employee is paid a base pay of \$1,000 and 9Â½ % commission on sales. The company deducts 18% of..

#### Write a recursive method that takes two non-negative integer

Write a recursive method that takes two non-negative integers m and n as parameters and returns the product.

#### Java program for line item application

This exercise explains you the process of testing and enhancing Line Item application. Open LineItemApp, Validator, Product, LineItem, and ProductDB classes that are in the c:java1.6ch06LineItem directory and review this code.

#### How can i stop tomcat from spilling off its own detail file

I've setup Tomcat 3.1 with Apache on my web server to serve JSP pages. How can I stop tomcat from spilling off its own detail file path on the server.

#### In a method named setfavoritesports declare

In a method named setFavoriteSports declare the sports array and populate it.  This method will return the sports array to the calling statement.  The 9 in the prompt below will print 1 for the first sport, then 2 for the 2nd one and so forth.  Use t..

#### Initialize an array

Which will legally declare, construct, and initialize an array?

#### Write a java program the displays the state bird

Write a Java program the displays the State bird and flower. The program should prompt the user to enter a State and print both the State bird and flower.

#### What aspects of judaism are rejected or reinterpreted

What theology does Jesus present in the two excerpts from the Gospels that are a part of the readings? What aspects of Judaism are strongly represented? What aspects of Judaism are rejected or reinterpreted?

#### Write a program deal that takes an integer and prints

Write a program Deal that takes an integer, save it in "kHands" from the keyboard and prints kHands poker hands (five cards each hand) from a shuffled deck, separated by blank lines Screenshot of the program and hands.

#### Write a for loop that computes the sum of all integers

Write a for loop that computes the sum of all integers from 1 to 10

#### Write a program that reports the comparison for all models

Write a program that reports the comparison for all models represented in the data file in a table, reporting: the number of each model installed; the total uptime, the total number of failures, and the overall MTBF.

#### 1 what makes a program easy to modify2 describe the order

1. what makes a program easy to modify?2. describe the order of magnitude of the following code section using bigo