1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
//
// main.cpp
// money dispenser 2
//
// Created by Jason Pulido on 3/3/15.
// Copyright (c) 2015 Jason Pulido. All rights reserved.
//
#include <iostream>
void dispense(int moneyEntered,int tens, int twenties, int fiftys);
int main(int argc, const char * argv[]) {
//variable declaration
int moneyEntered, tens, twenties, fiftys;
//
dispense(moneyEntered, tens, twenties, fiftys);
return 0;
}
void dispense(int moneyEntered,int tens, int twenties, int fiftys)
{
printf("Please enter amount desired to withdrawl (Increments of 10 only) :$");
scanf("%d", &moneyEntered);
if(((moneyEntered ==10) && (moneyEntered > 0)))
{
tens = moneyEntered / 10;
printf("tens : %d\n", tens);
}
if(((moneyEntered >=20) && (moneyEntered < 50)))
{
twenties = moneyEntered / 20;
printf("twenties : %d\n", twenties);
}
if(((moneyEntered >=50) && (moneyEntered > 0)))
{
fiftys = moneyEntered / 50;
printf("fiftys : %d\n", fiftys);
}
}
|