Computer problems,Computer help
*AX SOFT>>>Programming & Design

I have to write a C++ program...?


that lets you enter 2,311 pennies. The program should calculate and display the number of dollars, quarters,dimes,nickels, and pennies that I get back. I'm having problems on how do I get it to display. I know 2,311 pennies = $23.11, but I'm not sure how do display it individually. Can someone help me out and get me pointed in the right direction?

This logic will compute the dollars, quarters, etc. You can add it to your programme.

int pennies;
int dollars;
int quarters;
int nickles;
int dimes;

dollars = pennies/100;
pennies -= dollars * 100;
quarters = pennies/25;
pennies -= quarters * 25;
dimes = pennies/10;
pennies -= dimes * 10;
nickles = pennies/5;
pennies -= nickles * 5;

Then just print your values.

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • I have vista, how do i get my desktop to be a slideshow?

    1.) RIGHT CLICK on your desktop 2.) Click on PERSONALIZE 3.) Click SCREEN SAVER 4.) Click on PHOTOS and choose which folder you would like to display as a slideshow [if you need to, make a separ...

  • Why isn't this website working?

    possibly its not reconizing the OS. i assume their is a PHP script here on this site that is checking for the operating system version and denying clients that dont have XP or VISTA. why? its a ...

  • How do I display more than one column from a php while loop calling one field?

    In this example a table is used: // here you can set the number of columns $numOfCols = 3; // this is a counter $numOfEntries = 0; echo "<table>"; while( ... ) { // f...

  • What are some great bit torrent sites?

    ck out {Kceasy} download it from the filesharing place.

    ...
  • Does Gimp 2.4.4 work on vista?

    yeah it will work. how much ram do you have? in the my computer thing it should tell you the ram. im only 15 years old but i know the technical field very well, for graphic designers you need...

  • Palindrome Words in Javascript?

    <html> <head> <!-- No matter which you select as "best answer" - pick one. --> <script> function get(eid) { var d = document; var r = d.getElementById(e...

  • I need to no a free website or program where i can edit photos? Like i want to make a photo into a puzl photo?

    The Gimp is a great image editing program! It's a lot like photoshop except $700 cheaper. It's a free program and you can download it straight from ...

  • How do you let users create there own web page in my page?

    the easiest way would be o use something like xoops: ...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster