Question: Problem A: Pennies Per Pav Write a Java program that calculates the amount of a person would earn over a period of time if his

Problem A: Pennies Per Pav Write a Java program that calculates the amount of a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day, and continues to double each day The program should display a table showing the salary for each day, and then show the total pay at the end of the period. The output should be displayed in dollar amount, not the number of pennies. Prompt and obtain the input value for number of days. Caution: use a no. less than 30 as the total adds to a very big number!) Use Data validation loop to make sure that the valid data for days is >= 1 Sample Output:Please Enter the number of days 6 Here is the Salary for each day: Day Salary (Dollar Amount) 0.01 0.02 0.04 0.08 0.16 0.32 0.63 4 6 Total Salary Hint: Prompt and read dayUse data validation loop to make sure days> 1 Initialize salaryInCents (nt) to 1 Intialize total (int) to 0 Print the title for the table Print value of and salaryIncents 100.0 (convert to amount) total tota! + salaryInCents ; // update total salaryInCents2 salaryInCents; /ear the end of the loop ) /lend of for loop Outside loop Print the total /100.0 (convert to$ amount) with proper label
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
