Programming 4.5


4.5 Performance AssessmentStore Values in an Array and Display Them

In this assessment, you will create a program that uses an array structure and assignment statements to store four of your friend’s ages.  The output should display both the message and friends’ ages on the screen.

Instructions

Follow these instructions to complete your assignment:

  1. Write  C code for a program that does the following:
  • Create a character array that displays the message “My Friends Ages Program” at the declaration
  • Create a second array that will store 4 integer values
  • Use assignment statements to store the following friend’s ages
    • ages[0] = 25
    • ages[1] = 27
    • ages[2] = 24
    • ages[3] = 26
  • Use a puts() statement to display the message in the first bullet
  • Use a for() statement to display each age stored in the array element
  • The end output statement should display the friend’s ages.
  1. Note there is no flowchart with this exercise.
  2. Submit one Word document which contains:
  • A screenshot of your code
  • A screenshot of your output including the Title Bar of the console window.
  1. Submit the “.c” code file, which should include a comment line with your name and the date.
  2. Upload your work using the instructions below.

Review the output below to check your work!

Output

Here is what the output looks like.