C++ I need help please

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CWilliam912
    New Member
    • Mar 2008
    • 4

    C++ I need help please

    C++ Programming From Problem analysis to program design Third Edition D.S. Malik

    Consider the following function main:

    int main ()
    {

    int inStock[10] [4] ;
    int alpha[20] ;
    int beta[20] ;
    int gamma[4] = {11, 13, 15, 17} ;
    int delta[10] = {3, 5, 2, 6, 10, 9, 7, 11, 1, 8} ;

    .
    .
    .

    a. Write the definition of the function setZero that initializes any one-dimensional array of type int to 0.
    b. Write the definition of the function inputArray that prompts the user to input 20 numbers and stores the numbers into alpha.
    c. Write the definition of the function double Array that initializes the elements of beta tow two times the corresponding elements in alpha. Make sure that you prevent the function from modifying the elements of alpha.
    d-i pg. 545

    the list goes on from their but I need help. I am so lost with this programming assignment need help
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Please read the posting guidelines.


    I can help with specific programming and design issues but I cannot provide complete solutions or act as a tutor.

    Comment

    • CWilliam912
      New Member
      • Mar 2008
      • 4

      #3
      I really don't have any idea how to started off with this problem

      Comment

      • kyleschlitt
        New Member
        • Feb 2008
        • 4

        #4
        Then you have come to the wrong place for help.

        Open your textbook and refer to the section which deals with arrays. Make sure you go back to the beginning of arrays when they are first introduced. Then read slowly, and make sure you understand every detail as you come to it.

        If there is a specific detail you come across which confuses you, then feel free to post here about that and I'm sure many of us would be glad to help.

        Comment

        • CWilliam912
          New Member
          • Mar 2008
          • 4

          #5
          I am lost very lost with everything that I support to do doing

          Comment

          • sicarie
            Recognized Expert Specialist
            • Nov 2006
            • 4677

            #6
            Originally posted by CWilliam912
            a. Write the definition of the function setZero that initializes any one-dimensional array of type int to 0.
            Are you familiar with functions and return values?

            Are you familiar with creating and initializing arrays?

            Comment

            • rdsandy
              New Member
              • Oct 2007
              • 20

              #7
              CWilliam912, if its a programming assignment, you will have a tutor of some sort (whether at work, university etc) who gave you this problem and will therefore know the answer. Why not ask him/her first, not for the answer but for advice? Also a C++ book will help you greatly aswell.
              Last edited by sicarie; Mar 17 '08, 12:33 PM. Reason: thread hijack removed, response to hijacker removed

              Comment

              • weaknessforcats
                Recognized Expert Expert
                • Mar 2007
                • 9214

                #8
                Try reading this article. It may help.

                http://www.thescripts.com/forum/thread772412.html.

                Comment

                Working...