or email us at:
PRG 410 WEEK 5 ASSIGNMENT
C++ Programming I
ASSIGNMENT # 4
Problem 1: Write a program that asks the user to enter a number within the range of 1 through 10. Use a switch statement to display the Roman numeral version of that number.
Input Validation: Do not accept a number l
Problem 2: A bank charges $10 per month plus the following check fees for a commercial checking account:
$.10 each for fewer than
20 checks $.08 each for
$.06 each for 40-59
checks $.04 each for 60
or more checks
The bank also charges an extra $15 if the balance of the account falls below $400 (before any check fees are applied). Write a program that asks for the beginning balance and the number of checks written. Compute and display the bank’s service fees for the month.
Input Validation: Do not accept a negative value for the number of checks written. If a negative value is given for the beginning balance, display an urgent message indicating the account is overdrawn.
Problem 3: Write a program that asks the user for a positive integer value. The program should use a for loop to get the sum of all the integers from 1 up to the number entered. For example, if the user enters 50, the loop will compute the sum of 1, 2, 3, 4, … 50.
Input Validation: Do not accept a negative starting number. Write the algorithm of a program that reads two integers and outputs them in increasing order.
Problem 4: Write a program that uses a for loop to display the characters for the ASCII codes 0 through 127. Display 16 characters on each line.
Problem 5: Write a program using a do- while loop that lets the user enter a series of positive integers. The user should enter -99 to signal the end of the series. After all the numbers have been entered, the program should display
the largest and smallest numbers entered.
Problem 6: Write a program that generates a random number and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display Too[ high