Write a program that allows a student to practice


Problem 1 - Extend the pay program from Week 7 (PA 7-1) with while or do-while loop that asks the user if they want to continue. Allow both upper and lower case responses. When the processing of employees concludes, show the Total Number of Employees Processed, Total Gross Pay, Total Tax, and Total Net Pay (gross pay - taxes). Process at least 3 employees.

Problem 2 - Write a program that allows a student to practice subtraction. Tell the student when the answer is correct but allow them to try again if the answer is incorrect. Use random numbers in the range 0-100. Always subtract the smaller number from the larger. Use either a while or do-while loop.

Problem 3 - In mathematics the greatest common divisor (gcd) of two or more integers, which are not all zero, is the largest positive integer that divides each of the integers evenly. For example, the gcd of 8 and 12 is 4. For this assignment write a program that has the user enter two integers, then displays the GCD of those numbers. Include either a while or do-while loop.

Problem 4 - In Assignment PA 7-2 you wrote a program that rolled a pair of dice. In that program you detemined whether the player won, lost, or was instructed to "roll again" after the first roll of a pair of dice Extend that program as follows - if the player was told to roll again after the first roll (if it was a 4,5,6,8,9,10), save that number, call it "the point". Now continue rolling until one of two things happen -

1. if the player rolls a 7 before rolling "the point" number again, the player loses and the turn is over; or

2. if the player matches "the point" before a 7 is rolled the player wins and the turn is over.

If any number besides a 7 or "the point" is rolled nothing happens and the player just keeps rolling. Tell the player if they won or lost, the results of each roll, and how many rolls it took to end that player's turn. You may have to review De Morgan's Laws to get your while or do-while loop to work correctly! Show the number of rolls as shown in attachment.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a program that allows a student to practice
Reference No:- TGS02765594

Now Priced at $35 (50% Discount)

Recommended (92%)

Rated (4.4/5)