Classwork 8 - UMBC-CMSC104/General GitHub Wiki

For this assignment, we'll be editing an existing piece of code and adding things to it. READ THESE DIRECTIONS ENTIRELY BEFORE MOVING ON.

To begin, we'll be copying a file called cw08.c to your current directory (include the dot in the command):

cp /afs/umbc.edu/users/m/w/mwilson3/pub/cmsc104/cw08/cw08.c .

Edit it using your favorite text editor, and look for the directions that say CW08 in comments.

Three things are expected of you:

  • Create an integer array called numbers with 10 elements. Use brackets to initialize the values with numbers 1-10 in that order.
  • Create a double array with 5 elements called fahrenheit. Do NOT initialize it.
  • Assign values to the five elements of fahrenheit using assignment. You'll need 5 lines of code here to do this. Assign the values 75, 65, 55, 45, and 35 (in that order).

Make sure you look for the indicators in the code as to where you should write these things.

If correct, your output should be:

Sum: 55
75.000000 degrees F is 23.888889 degrees C
65.000000 degrees F is 18.333333 degrees C
55.000000 degrees F is 12.777778 degrees C
45.000000 degrees F is 7.222222 degrees C
35.000000 degrees F is 1.666667 degrees C

To submit:

submit cs104_wilson cw08 cw08.c

To submit