Home › Forums › C Programming › Banking
- This topic has 1 reply, 2 voices, and was last updated 15 years, 12 months ago by GWILouisaxwzkla.
Viewing 1 reply thread
- AuthorPosts
- November 26, 2008 at 9:08 pm #2160StarlaRosasParticipant
Hey dudes, I need a help on borland c, I need Some idea, the programs is about, if the user put some amunt of money, The program will have to give 3 ways to get back that amount of money, example, if he put 200
the computer will say2 of one hundred dollar
10 of twenty dollars
20 of ten dollars
“this gives 200 hundred dollars”
can you give any ideas thats I can start with my programs, clues or something else, to begun with my program. this will be on borland turbo c - December 1, 2008 at 7:35 pm #3486GWILouisaxwzklaParticipant
Could do this:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576<br />/****************************************************************<br />* File Name : c:programstempcg.cpp<br />* Date : December,1,2008<br />* Comments : new project<br />* Compiler/Assembler :<br />*<br />*<br />*<br />*<br />*<br />* Program Shell Generated At: 2:09:49 p.m.<br />=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/<br /><br /><br />#include <br />//#include <br />//#include <br />//#include <br />//#include <br />//#include <br /><br />using namespace std;<br /><br /><br />//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ FUNCTION PROTOTYPES @@@@@@@@@@@@@@@@@@@@@@@@@@<br /><br /><br /><br />//##################################################################################<br /><br /><br />//main function ******************************<br /><br />int main ( )<br />{<br /><br />cout << "Enter change amount : ";<br />float change;<br />cin >> change;<br /><br />int hundreds = 0;<br />int fifties = 0;<br />int tens = 0;<br />int tempChange = change;<br /><br />while ( tempChange >= 100 )<br />{<br />hundreds ++;<br />tempChange -= 100;<br />}<br /><br />tempChange = change;<br />while ( tempChange >= 50 )<br />{<br />fifties ++;<br />tempChange -= 50;<br />}<br /><br />tempChange = change;<br />while ( tempChange >= 10 )<br />{<br />tens ++;<br />tempChange -= 10;<br />}<br /><br />cout << "you can change " << change << " with: " << endl;<br />cout << hundreds << " hundreds" << endl;<br />cout << fifties << " fifties " << endl;<br />cout << tens << " tens" << endl;<br /><br /><br />return 0 ;<br />}<br /><br />output:
123456789<br />Enter change amount : 200<br />you can change 200 with:<br />2 hundreds<br />4 fifties<br />20 tens<br />Press any key to continue<br /><br />
- AuthorPosts
Viewing 1 reply thread
- The forum ‘C Programming’ is closed to new topics and replies.