Thread: Assignment with Arrays, Using C

  1. #1
    Registered User
    Join Date
    Mar 2016
    Posts
    1

    Assignment with Arrays, Using C

    I am in a basic, starting programming class using C and we just learned about using arrays and what they are used for.


    My professor then threw us into this assignment which I can't really wrap my mind around too much.


    I am using notepad++ to edit code and Cygwin to run the code also.


    The first image is the "task" that i need to complete. The second is the starting code for the actual program, and the third is a little cheat sheet for certain variables and functions.


    Ultimately I am looking for someone that can point me in the right direction of how I should approach this possibly give me some pointers.


    Any help is greatly appreciated, Thanks in advance.


    Assignment with Arrays, Using C-c-help3-jpg

    Assignment with Arrays, Using C-c-help1-jpg


    Assignment with Arrays, Using C-c-help2-jpg

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    I really want to believe that you're taking this class seriously and putting in a decent amount of effort. Unfortunately, this didn't come across in your post. You posted a screen-shot of the assignment and didn't ask any specific questions about where you're stuck, instead asking a general "where do I start". I'll give you the benefit of the doubt since you're new here, but you really should show that you've attempted to understand the problem by asking clear questions about the parts you don't understand.

    Whenever you receive an assignment and don't even know where to start, you need to follow these steps.

    Step 1: Move away from the computer. Until you have a plan on how to solve this problem, you should not be writing any code. Instead, take out some paper and a pen.

    Step 2: Extract the requirements. Assignments like this are like any other "word problem" you might encounter. Take the verbose description, and distill out the necessary information into a list of requirements.

    Step 3: From that list of requirements, break the problem down into discrete steps. These steps should be a guide on how to go from start to finish in order to solve the problem. Go through each step in order, making sure that they take you from start to completion.

    Step 4: Break down the steps further. Determine all the details that have to be handled in order to solve each step. Go through it again "by hand" to make sure the steps properly solve the problem.

    Now you have a plan. In fact, if you break the list of steps down to sufficient detail, there should be a tight correlation between each step and corresponding line of code required. This is called pseudocode. The question of "where to start" should become quite obvious at this point.

    Step 5: Go back to the computer and start developing code.

    When you start writing code, write just enough code to solve the very first step only. Add any supporting/test code and compile. Fix any warnings and errors. Run the program to ensure you get the expected results. If not, fix it.

    When you're sure you have that first bit working, add a little more code. Fix any warnings and errors. Run the program to ensure you get the expected results.

    Follow this process, building your program up gradually and testing along the way. Before you know it, you'll have a complete and functional program.

    A development process

    If at any point you get stuck, post back with what you've done and we can help you from there.

  3. #3
    Registered User
    Join Date
    Jan 2016
    Location
    India
    Posts
    4
    If you really want to learn development, I can suggest few points with few online resaources:
    1) If you are planning to learn in better way, don’t plan just switch on you laptop and start writing program, no matter what you are writing, program should be compiled and run.
    2) After writing programs you will get confidence then think about your professor’s requirement what he need actually.
    3) If you are facing problem, go to online solution and ask the problem to your professor.

    One thing that I noticed in your question that you are looking for starting programming likes, here is the list of few online resources where you can start learning.

    Arrays in C - Cprogramming.com
    https://www.cs.uic.edu/~jbell/Course...ng/Arrays.html
    C programming solved programs/examples with solutions - C source Codes

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with an assignment for 2D Arrays
    By Jordan Velez in forum C++ Programming
    Replies: 2
    Last Post: 05-11-2015, 12:58 PM
  2. Trouble with assignment to arrays
    By MC++ in forum C Programming
    Replies: 13
    Last Post: 04-17-2012, 02:52 PM
  3. C programming assignment (with arrays)
    By COG92 in forum C Programming
    Replies: 59
    Last Post: 10-16-2011, 11:20 PM
  4. Assignment of Two-Dimensional Arrays
    By LuckY in forum C++ Programming
    Replies: 4
    Last Post: 08-06-2004, 03:40 PM
  5. Assignment of two char arrays
    By moemen ahmed in forum C++ Programming
    Replies: 4
    Last Post: 07-07-2002, 12:44 AM