Beginner programmer need help starting a program

This is a discussion on Beginner programmer need help starting a program within the C Programming forums, part of the General Programming Boards category; Hi i have to write a program for school but i don't have the slightest idea where to start any ...

  1. #1
    Registered User
    Join Date
    Oct 2013
    Posts
    12

    Beginner programmer need help starting a program

    Hi i have to write a program for school but i don't have the slightest idea where to start any help would be greatly appreciated!....

    Write a function called clockKeeper that takes as its argument a dateAndTime structure. The function should call the dateUpdate function, and if the time reaches midnight, the function should call the dateUpdate function to switch over to the next day. Have the function return the updated dateAndTime structure.

  2. #2
    Registered User
    Join Date
    Oct 2013
    Posts
    19
    So, why don't you visit this A development process

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    2,422
    what have you tried so far?
    Code:
    namespace life
    {
        const bool change = true;
    }

  4. #4
    Registered User
    Join Date
    Oct 2013
    Posts
    12

    This is what i have so far

    Quote Originally Posted by Elkvis View Post
    what have you tried so far?
    Name:  Help.PNG
Views: 173
Size:  10.5 KB

  5. #5
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    You shouldn't have function declarations inside another function.

    Were timeUpdate and dateUpdate given to you/previously written, or do you need to write them as well?

  6. #6
    Registered User
    Join Date
    Oct 2013
    Posts
    12
    Quote Originally Posted by tabstop View Post
    You shouldn't have function declarations inside another function.

    Were timeUpdate and dateUpdate given to you/previously written, or do you need to write them as well?
    I used those because it says that call the timeUpdate function and if time reaches midnight to use dateUpdate...I did it like this because the book shows a program using timeUpdate as such.

  7. #7
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by chey15 View Post
    I used those because it says that call the timeUpdate function and if time reaches midnight to use dateUpdate...I did it like this because the book shows a program using timeUpdate as such.
    Right, I know the spec uses those function names. The question I'm asking is: do you already have those functions (from a previous assignment, from this assignment, from the book, etc) or is writing those functions also a part of this assignment?

    If those functions already exist, then you will have to determine how to use them appropriately -- for instance: I might expect a function called dateUpdate to take information about what to update the date to. You seem to be using it as an add-one-to-current-value function. And that may very well be what it does; but I don't know -- and if you are supposed to write the function you need to make that decision before you start.

  8. #8
    Registered User
    Join Date
    Oct 2013
    Posts
    12
    Quote Originally Posted by tabstop View Post
    Right, I know the spec uses those function names. The question I'm asking is: do you already have those functions (from a previous assignment, from this assignment, from the book, etc) or is writing those functions also a part of this assignment?

    If those functions already exist, then you will have to determine how to use them appropriately -- for instance: I might expect a function called dateUpdate to take information about what to update the date to. You seem to be using it as an add-one-to-current-value function. And that may very well be what it does; but I don't know -- and if you are supposed to write the function you need to make that decision before you start.
    Oh, no I don't have those functions from a previous assignment or anything

  9. #9
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by chey15 View Post
    Oh, no I don't have those functions from a previous assignment or anything
    Then you can make those functions do what you want them to do, as +1 day or whatever. But then you will need to make those functions as well. You've got the basic declaration there in the top of your function; you'll need to move them out of the function and then write those functions. The basic outline of the function you've got looks correct.

  10. #10
    Registered User
    Join Date
    Oct 2013
    Posts
    12
    Quote Originally Posted by tabstop View Post
    Then you can make those functions do what you want them to do, as +1 day or whatever. But then you will need to make those functions as well. You've got the basic declaration there in the top of your function; you'll need to move them out of the function and then write those functions. The basic outline of the function you've got looks correct.
    Okay Thank you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner Programmer. Help please!
    By TheWhiffet in forum C Programming
    Replies: 5
    Last Post: 04-23-2011, 01:15 AM
  2. Help! Beginner Programmer....
    By Shodai100 in forum C++ Programming
    Replies: 6
    Last Post: 09-10-2010, 02:54 AM
  3. Beginner programmer
    By Kool4School in forum C Programming
    Replies: 16
    Last Post: 11-24-2008, 12:16 PM
  4. Beginner Programmer
    By silverjump in forum C++ Programming
    Replies: 2
    Last Post: 04-04-2005, 06:03 PM
  5. Any beginner C++ programmer wants to.....
    By incognito in forum C++ Programming
    Replies: 5
    Last Post: 12-06-2001, 07:15 AM

Tags for this Thread


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