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

  Write a program to open a file for reading

Write a program to open a file for reading that has twenty (20) rows and in each row there are three (3) columns.

  You will implement a simplified version of the set class

you will implement a simplified version of the set class. you must implement all functions defined in the provided file

  Write a program that uses joptionpanes to perform

For example, if the distance of travel is 30 kilometers, the time of travel is 2 hours, then the speed is 30/2 = 15 (kilometers per hour).

  Object oriented programming paradigm is better choice

Explain why object oriented programming paradigm is considered better choice than structured programming paradigm. Does it reflect our "natural" way of thinking or do you find it artificial?

  Basic game of battleship

Basic Game of Battleship - Analyze a basic set of requirements and apply top-down design principles for a problem and eliminate redundancy within a program by applying loops and functions

  Throws an exception from a deeply nested

Write a program that throws an exception from a deeply nested function and still has the catch handler following the try block enclosing the initial call in main catch the exception

  Write an application that shows the sum

This is for Object-Oriented Programming Using C++ language - Edition Joyce Farrell. Please ensure to read everything that I have wrote so that there is no confusion.

  Calculates different formulas that converge to the number pi

Write a C program (Care should be taken not to use extensions of C + + language in your work ) that calculates different formulas that converge to the number  pi,  to compare the speed of convergence of these formulas. Each form will be calculated by..

  You have just upgraded your system

You have just upgraded your system to a "fast and wide" SCSI interface. This system has a floppy disk, a CD-ROM and five 8-gigabyte fixed disks. What is the device number of the host adapter? Why?

  Cancer genome identification tool

Cancer Genome Identification Tool - Create structure charts for a given problem - Determine an appropriate functional decomposition or top-down design from a structure chart

  Write a function named largest which will receive the array

Write a function named largest which will receive the array as input and return the variable LargestNumber.

  Create an array of boat objects

Create Classes for each of the object types that need to be stored, as indicated above.

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