Modify the test score application

Assignment Help C/C++ Programming
Reference no: EM13761543

Modify the Test Score application so that it uses Big Decimal arithmetic to

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: EM13761543

Questions Cloud

Intangible assets section : Prepare the intangible assets section of Pacific Inc. at December 31,2012. How much amortization expense is included Pacific's income for the year ended December 31,2012? Show all supporting computations.
Write a review on case study splitting by gordon matta clark : Write a review on the case study Splitting by Gordon Matta Clark.
What will be the value stored in edi : Assuming that 00417005 is the address loaded in EDI, what will be the value stored in EDI following the repne scasb instruction? What will be stored in ECX
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.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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