Modify testscoreappmath

Assignment Help Basic Computer Science
Reference no: EM13761540

Modify TestScoreAppMath as described below.

1. Use the += operator to increase the scoreCount and scoreTotal variables. Then test this to makes sure it works.

2. As the user enters test scores, use the methods of the Math class to keep track of the minimum and maximum scores. When the user enter 999 to end the program, display these scores at the end of the other output data. Now, test these changes to make sure that they work.

3. Change the variable that you use to total the scores from a double to an int data type. Then use casting to cast the score count and score total to doubles as you calculate the average score and save that average as a double. Now, test that change.

4. Use the NumberFormat class to round the average score to one decimal place before displaying it at the end of the program. Then, test this change. Note that the rounding method that's used doesn't matter in a program like this.

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 != 999)

{

// 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;

}

else if (testScore != 999)

System.out.println("Invalid entry, not counted");

}

// 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);

Reference no: EM13761540

Questions Cloud

Write an essay on love philosophy and shakespeare : Write a 1500 words essay on Love, philosophy, shakespeare.
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 ..
Identify role of political economy in international trade : Identify the role of the political economy in international trade; how do these roles affect the US and Mexico? Use scholarly articles to support your stance.
Cost per output and cost per outcome response : A human service agency did not determine the cost per output and cost per outcome.
Modify testscoreappmath : Use the += operator to increase the scoreCount and scoreTotal variables. Then test this to makes sure it works.
Partnership and corporate tax returns : Use the partnership and corporate tax returns for the practice sets titled, "Pet Kingdom" and "ROCK the Ages, LLC" that you prepared in Weeks 3 and 5 in order to complete this assignment.
Write a paper about communicative competence for parents : Write a paper about communicative competence for parents and teachers of young children. explain why it is important for children to acquire.
Supply and demand from the simulation : How may you apply what you learned about supply and demand from the simulation to your workplace or your understanding of a real-world product with which you are familiar?
Compare and contrast the different iss policies : Describe the different ISS policies associated with risk management. Compare and contrast the different ISS policies associated with incident response teams (IRT).

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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