Thread: C++ programing, need help.

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    4

    Question C++ programing, need help.

    Hi I am a beginner and just learning C++, I need your help to write 2 programs:

    1st:
    Convert 1693 cents to: dollars, quarters, dimes, nickels, and pennies.

    2nd:
    Ask user how much money in his bank? How much money he wants to spend a month? And how many months he needs to spend it all?

    Thank you!

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    4

    Is there any one who knows hot to write these programs?

    can someone help to write these programs, or is it something wery hard to do?
    appreciate your time!

  3. #3
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    is that the 'please complete my assigment bell' i hear ringing?
    Heres a few pointers, come back with some code!

    1
    --
    think simple maths operators and connect them with the number of cents in a dime, quarter etc..

    2
    --

    I dont see the point of this application - it takes three sets of user input but does not appear to process it in any way
    Last edited by iain; 12-12-2001 at 03:59 PM.
    Monday - what a way to spend a seventh of your life

  4. #4
    Registered User
    Join Date
    Dec 2001
    Posts
    4
    thank's for "help" you are extremelly inteligent!!!!...???

  5. #5
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    dont get sarcastic - write some code and then come back - why do think no-one has answered you yet?
    Monday - what a way to spend a seventh of your life

  6. #6
    Registered User
    Join Date
    Dec 2001
    Posts
    4

    Smile

    Hmm....
    If you knew how many numbers I wrote... just simply have no wish to write the wrong program I did here. I am not sure if I did it correct at all. But anyway, nevermind, and thank's for your time.
    Ita

  7. #7
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    psedocode for 1st one to get u going.....

    put coffee,sugar and milk in cup.
    pour boiling water into cup and stir.
    sup the tasty beverage until the fog in your brain clears.
    now push brain gear lever to 1st gear.
    cognitate for a few minutes about how you as a person would solve this problem.
    you have 1693 cents. There are 100 cents to a dollar. so dollars=totcents/100
    all that thinking to get this far must have got you hungry.
    goto fridge; // valid use of goto in this case for extra performance
    open door
    look for tiramisu or zabaglione and stuff your face.
    ensure brain is still in 1st gear
    we now know that dollars = 16 = 1600 cents.
    totalcents=totalcents - 1600 = 93 cents.
    quarters i guess are 25c so totalcents/25 = numofquarters=3=75c
    totalcents=totalcents - 75 = 18c
    continue for dimes and pennies.
    now shift brain gear lever to 2nd gear, have more coffee and tiramisu and fire your compiler up and convert that to c++ and thats the first one done.

    The second problem is easier than this one. So go do it.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C programing for DNA...
    By S16 in forum C Programming
    Replies: 9
    Last Post: 04-29-2009, 09:25 AM
  2. Programing microcontrollers in c
    By gorabhat in forum C Programming
    Replies: 2
    Last Post: 09-09-2008, 10:40 AM
  3. Human brain and programing
    By avgprogamerjoe in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 08-27-2007, 04:48 PM
  4. Non programing Question
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 06-21-2002, 06:55 AM
  5. C++ Programing
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 10-06-2001, 04:13 PM