Modify the test score application

Assignment Help Mathematics
Reference no: EM13762783

Modify the Test Score application so that it uses Big Decimal arithmetic to calculate the average test score with result rounded to 1 decimal place. Note that because the scoreCount and scoreTotal are int, you don't have to create the Big Decimal object from strings.
import java.util.Scanner;

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: " + round(averageScore,1) + "\n";

System.out.println(message);

}

Reference no: EM13762783

Questions Cloud

The community/public health nurse problems : Describe the population served by the nurse in this role.
Describe some of the reasons for the emergence of dystopian : Describe some of the reasons for the emergence of the dystopian point of view in literature. How do you see these reasons reflected in the reading assigned this week?
What is swimkidss margin of safety : Swimkids is a swimsuit manufacturer. They sell swim suits at a selling price is $30 per unit. Swimkids variable costs are $18 per unit. Fixed costs are $71,100. Swimkids expects sales of $288,700 next year. What is Swimkids's margin of safety?
Fixed selling and administrative costs : U.S. Telephone Cellular sells phones for $100. The unit variable cost per phone is $50 plus a selling commission of 10% (based on the unit sales price per phone). Fixed manufacturing costs total $1,040 per month, while fixed selling and administrativ..
Modify the test score application : Modify the Test Score application so that it uses Big Decimal arithmetic to calculate the average test score with result rounded to 1 decimal place. Note that because the scoreCount and scoreTotal are int, you don't have to create the Big Decimal ..
Financial information for ford and gm : Using the financial information for Ford and GM, answer the following questions.
Ritz furniture has a contribution margin ratio : Ritz Furniture has a contribution margin ratio of 0.17. If fixed costs are $171,500 how many dollars of revenue must the company generate in order to reach the break-even point?
Attend college full-time at a cost : Susan is trying to decide whether or not to attend college during the next 12-week session.
How does your protagonist relate to society : How does your protagonist relate to society? In what ways is your literary work or film Greek? What epic qualities are evident in your work?

Reviews

Write a Review

Mathematics Questions & Answers

  Questions on ferris wheel

Prepare a Flexible Budget Gator Divers is a company that provides diving services such as underwater ship repairs to clients in the Tampa Bay area.

  Logistic map

This assignment has two question related to maths. Questions are related to bifurcation cascade and logistic map.

  Finding the probability of cards

This assignment has questions related to probabiltiy.

  Systems of ode

Find all the xed points, and study their stability and Draw the phase portrait of the system, as well as the graphs of the solutions in all relevant cases.

  Derive the boolean expression

Derive the Boolean Expression and construct the switching circuit for the truth table stated

  System of equations

Evaluate which equations are under-identified, just-identified, and over-identified.

  Linear programming problem

Linear programming problem consisting of only two constraints with one objective function.

  Find the natural domain

Find the natural domain of the given functions.

  Introduction to numerical methods

Compute the coecients of the polynomials using the term recurrence relation.

  Chart of the topological manifold

De?nition of smoothness of functions on a smooth manifold is chart independent and hence geometric.

  Mathematics in computing

Questions related on mathematics in computing.

  Complex problems

Complex problems

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd