I need help..bad

This is a discussion on I need help..bad within the C Programming forums, part of the General Programming Boards category; I recently missed a lecture due to bronchitis and I was doing fine in my beginning C class up to ...

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    6

    I need help..bad

    I recently missed a lecture due to bronchitis and I was doing fine in my beginning C class up to this point but I have a project due in a couple days using the while statement and I'm lost. The gist of the program is we are to enter a fee amount, a monthly payment amount, and a deposit amount and have the C program continue to count payment numbers until the amount owed reaches 0. I'm just not sure where to start.

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,159
    I would probably start with asking the user for the fee amount.

    No one is going to do your assignment for you. Show us code for as much as you know how to do and people will provide answers to your specific questions.
    If you understand what you're doing, you're not learning anything.

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    107
    Quote Originally Posted by fsutati View Post
    I recently missed a lecture due to bronchitis and I was doing fine in my beginning C class up to this point but I have a project due in a couple days using the while statement and I'm lost. The gist of the program is we are to enter a fee amount, a monthly payment amount, and a deposit amount and have the C program continue to count payment numbers until the amount owed reaches 0. I'm just not sure where to start.
    Start with

    Code:
    #include <stdio.h>
    
    int main(int argc, char** argv)
    {
         return 0;
    }
    Then try man printf, man scanf.

  4. #4
    Registered User
    Join Date
    Oct 2010
    Posts
    6

    What I have

    This is what I have so far. I dont think my while statement is correct because none of my calculations are working.

    I attached it in a word document.
    Attached Files Attached Files

  5. #5
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by fsutati View Post
    This is what I have so far. I dont think my while statement is correct because none of my calculations are working.

    I attached it in a word document.
    Please... post code in the open using the forum's code tags.

  6. #6
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,831
    You haven't initialized out_bal. Currently you are checking it in your while loop but its value is undetermined. Maybe it's initialized to zero but it is unwise to rely on that.

  7. #7
    Registered User
    Join Date
    Oct 2010
    Posts
    5
    You asked about the same project in another thread in which I pointed you to my thread which is the exact same program. It may help you to see a working one.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. bad and fail of steam
    By George2 in forum C++ Programming
    Replies: 8
    Last Post: 02-19-2008, 02:07 AM
  2. Can you still view the bios screen with a bad CPU?
    By HyperCreep in forum Tech Board
    Replies: 4
    Last Post: 12-31-2006, 05:57 PM
  3. Replies: 6
    Last Post: 11-12-2005, 10:57 AM
  4. Bad coding habits
    By Magos in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 09-12-2005, 05:44 PM
  5. Shocking(kind of)
    By Shadow in forum A Brief History of Cprogramming.com
    Replies: 25
    Last Post: 12-10-2002, 07:52 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21