Prev Up Next
Go backward to 6.2 Triangles
Go up to 6 Labs
Go forward to 6.4 BIG project

6.3 Change

This lab will get you to deal with various conversions between real or floating point numbers and integers. In Pascal, there are two standard functions, round() and trunc().

For this lab, please write a program that does the following:

  1. Prints out identification information:
  2. Request input, with a prompt, for a real number of dollars. This needs to have the ability to input fractional parts of a penny.
  3. Print out the whole number of dollars.
  4. Print out the number of cents (rounded).
  5. Print out the fractional cents lost or gained.
  6. Convert the whole dollars to bills. Use only the denominations of Hundreds, Fifties, Twenties, Tens, Fives, and Ones.
  7. Print out the total number of bills.
  8. Convert the cents to quarters, dimes, nickels, and pennies. Print out theses values. Use the minimum number of coins. (All pennies is NOT acceptable after 4 cents!)
  9. Print out the total number of coins.
Test your program with a number of values. Turn in a copy of your program when run with the value $1,079.9945.

Mark your output with:

Place the lab in the instructor hand in box in BUS R6E, the "terminal room".
Instructor: ltaber@pima.edu** Red's Home page** The Pima College Site

Prev Up Next