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);
}
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?
|