Thread: New to C

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    1

    Unhappy New to C

    Hi guys

    Ive stumbled across a question which has got me stumped. Im very new to algorithms and C syntax so im not to sure how to approach this question:

    "You are asked to write a simple program that will accept an integer value in the
    range of 5-95 and in increments of 5 at a time, representing the number of cents to
    give to a customer in their change. The program should calculate how many coins
    of each denomination and display this to the user. Valid coin values are 50, 20, 10
    and 5. Your solution (program and algorithm) should be modular in nature. This
    requires the submission of a high-level algorithm and suitable decompositions of
    each step."

    Im not sure whether or not to use looping or if else statements. I also dont know enough to figure out how to code these 5 increments then display how many coins are needed for the change.

    Any hints on how to tackle this one would help me heaps.

    ive been stuck on it for 10 hours.

    Cheers

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by kermi3
    Welcome to the boards. If you haven't already done so then please take some time to familiarise yourself with the faq:
    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

    Make sure you have a look at the the posting guidelines:
    http://cboard.cprogramming.com/annou...ouncementid=51
    Following the rules will ensure you get a prompt answer to your question.

    Remember, too, that the board has a search facility, a link is at the top of your screen:
    http://cboard.cprogramming.com/search.php
    It will often get you a quicker answer to your questions than waiting for a response to one you have posted.

    It appears that you are posting a homework assignment or other project.

    Please don't ask people to do all your work for you, See the announcement on Homework at the top of all forums to see what is acceptable or PM me. Basically people are happy to help, but they're not going to do it all for you.

    Show us what you've got, show your code (using code tags), or where you're confused and someone will be happy to help you I'm sure. If it's something that you absolutely don't understand how it works, like you have no clue how qsort works, then ask a general question about the function and I'm sure someone will explain it. Though they may not give you all of the code for it, but someone will explain the concept.


    On obivous homework questions especially, I like to remind people of the board's ninth guildeline, while this board is very helpful to people, make sure you have your instructor's permission before seeking help on assignments. While people on these boards are more than happy to help, we discourage people from asking for help on graded work without the instructor's permission, and we claim no repsonsibilty for any cheating or honor violations.

    Feel free to PM me with any questions.

    Good Luck,

    Kermi3

    Read and follow the above instructions, and try your post (in the same thread) again.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Apr 2004
    Posts
    173
    Bump for the search, heres a relevant link that may help you start off:
    http://cboard.cprogramming.com/showthread.php?t=63801

    Think before you code especially on problems you are unfamiliar with. Also if you are new to C then I would recommend spending some time looking over C syntax and features before diving into problems.

Popular pages Recent additions subscribe to a feed