View Single Post
Old 02-04-2007, 10:55 PM   #9 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,720
redhead is on a distinguished road
Ok, you convinced me.. .I'll do the start part, you can then complete it...
Code:
#include <iostream>

int main()
{
  int amount=-1;
  while(amount < 0){
    std::cout << "Input amount of pennies: " ;
    std::cout.flush();
    std::cin >> amount;
    if(amount < 0)
        std::cout << "It's impossible to have negative amount" << std::endl;
  }
  if(amount >= 100){
    std::cout << "Dollars:\t" << amount/100 << std::endl;
    amount = amount %100;
  }
  if(amount >= 25){
    /* now you continue */
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote