Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA PROGRAMMING [H4-1] (Rollstats.java) { numRoll==1000 } Write an application that reads an int numRolls from the user, then repeats the following numRoll times: generate

JAVA PROGRAMMING

image text in transcribedimage text in transcribed

[H4-1] (Rollstats.java) { numRoll==1000 } Write an application that reads an int numRolls from the user, then repeats the following numRoll times: generate a random int between 1 and 6 (simulate a roll of a single die), then update the total roll count for that particular roll value. Thus, you'll need 6 int variables to count how many rolls occur for each of 1, 2, 3, 4, 5, and 6. After the loop ends, print out the roll counts for each roll value. [H4-3] (Calculation.java) LiAmt==1500.00, iRate==10.0% } Write an application that prompts the user to enter an initial savings deposit as a double value iAmt in dollars, followed by an annual double interest rate iRate, given in % (your code should divide this input by 100.0 to get the dimensionless quantity to use in your calculations). Then print out a table as follows showing the growth of your i Amt savings as it earns iRate interest, compounded yearly over the first 5 years. For iAmt == 100.00 and iRate == 6.7%, your table should look something like this: Year # iAmt Cumulative Interest 0 1 2 3 4 5 $100.00 $104.70 $109.62 $114.77 $120.16 $125.82 $0.00 $6.70 $9.62 $14.77 $20.16 $25.82 Use one or more tabs (\t) between columns in the table (including in the header) and be sure that dollar amounts begin with $ and have exactly two decimals. Don't worry about precise formatting. Note that iAmt* (1+iRate) for any year gives the value of iAmt in the next row of the table. The cumulative interest is that earned in each year before and including the current one. Suggestion: use Stdout: printf ("$%.2f", 6.7) to print out $6.70

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions