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

  Find the elasticity of demand

The demand function for a product is given by p= -0.01x^2 - 0.1x + 6 where p is unit price and x is the number in thousands.

  Find the width of the sidewalk

A rectangular pot of ground measuring 12 meters by 20 meters is surrounded by a sidewalk of uniform width. The area of the sidewalk is 68 square meters. Find the width of the sidewalk.

  Find all solutions to the two equations

Find all solutions to the two equations: (use radian measure, and algebra techniques. Don't just look for the zeros on a graphing calculator) (a) tan^2(t)-2tan(t)+1=0 (b) 2sin^2(t)-sin(t)-1=0

  Find the equation of the line that is perpendicular

find the equation of the line that is perpendicular to x+5y=-3 and taht passes through (-2,-1). Express your answer in stanard form.

  The monitor estimates this value by calculating the slope

question a cardiac monitor is used to measure the heart rate of a patient after surgery. it compiles the number of

  Find how many tennis rackets the manufacturer needs

The cost C to produce x number of tennis rackets is The tennis rackets are sold wholesale for each, so revenue R is given by Find how many tennis rackets the manufacturer needs to produce and sell to break even.

  Determine the loan simple interest rate to the tenth

A principal of $1800 is borrowed over 9 months. The future value is $1910. Determine the loan simple interest rate to the tenth of a percent?

  What is the constraint on money to invest

Profit for each big shelf is $85 and for each medium shelf is $75. What is the constraint on money to invest?

  Calculate the number of bridge hands

Calculate the number of bridge hands which contain and calculate the probability of being dealt each of the hands in parts (a), (b), and (c). Give your answers to 5 decimal places.

  Find the probability that at least one of these light bulbs

Two light bulbs are selected from the sample without replacement. Find the probability that at least one of these light bulbs failed the test. Enter your answer as a number between 0 and 1 accurate to 3 decimal places.

  Set up inital simplex tableau

Set up the inital Simplex Tableau and determine the first pivot. Please show all steps. please do not complete the problem

  Prove the equation

Prove that 1/(2n) is less than or equal to [ 1 * 3 * 5 *...* (2n - 1)] / (2 * 4 *...* 2n) whenever n is a positive integer.

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