Thread: New to the forum, need a bit of help/guidance

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    3

    New to the forum, need a bit of help/guidance

    I have to write a program for an assignment,

    basically the program must work out the amount tat each person should pay towards a tea kitty each week. Each person drinks drinks drinks a day. 1 pint of milk makes 1 drinks, the teabags come in boxes of 480 teabags(1 teabag makes 1 drink) and the bag of sugar is used to make 100 drinks.


    I just dont know where to start(im not askin for someone to do it for me but for some pointers),

    i obviously declare the variables at the start i got that bit but its the rest of the program

    Id appreciate your help,
    Last edited by DC_FC79; 11-18-2006 at 05:09 AM.

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    It's just a mathematical problem. You start by solving the problem on paper. Then you code the method you used to solve it into a program.

    i obviously declare the variables at the start
    That's not at all obvious. Instance variables can be declared at the end, or spread all over the class (the latter is a really bad idea, though). Local variables can (and should, IMO) be declared where they're first used.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    3
    how come you know so much

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Practice, interest, and a lot of reading.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    Registered User
    Join Date
    Nov 2006
    Posts
    3
    Quote Originally Posted by CornedBee
    Practice, interest, and a lot of reading.
    do you read books, can you recommend any for C#

  6. #6
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Not for C#, no. All I know about C# (not very much, actually) I learned from a tutorial, some playing around with it, and mostly a lot of knowledge of Java and C++.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  7. #7
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Quote Originally Posted by DC_FC79
    do you read books, can you recommend any for C#
    http://www.amazon.co.uk/Programming-.../dp/0596006993

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. porting application from 32 bit to 64 bit error
    By gandalf_bar in forum Linux Programming
    Replies: 1
    Last Post: 09-14-2005, 09:20 AM
  2. Bit processing in C
    By eliomancini in forum C Programming
    Replies: 8
    Last Post: 06-07-2005, 10:54 AM
  3. The Contest Forum has switched
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 08-16-2002, 03:10 PM
  4. Assembly forum
    By Garfield in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 11-18-2001, 08:03 PM
  5. Array of boolean
    By DMaxJ in forum C++ Programming
    Replies: 11
    Last Post: 10-25-2001, 11:45 PM