Graders! Take Points Off If Output Is Not Close To What Is Given! Function Names Should Be Appropriate!
Graders! Take Points Off If Output Is Not Close To What Is Given! Function Names Should Be Appropriate!
Graders! Take Points Off If Output Is Not Close To What Is Given! Function Names Should Be Appropriate!
vector.script
Must be in 1 script called vector.script 3 3
Script has the following output: 32 32
(array names may differ, but values must be the same. Problem numbers are
included for ease of grading but are not required in the script. ARRAY VALUES
MUST BE HARD CODED! NO USER INPUT!)
(4 points each question)
1.
Before
a1[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 3}
After the array is multiplied by an integer (5 is used as an example, however students
may use any integer as the multiplier)
a1[] = {5, 10, 15, 20, 25, 30, 35, 40, 45, 15}
2.
Before
a2[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 3}
After the array is summed with an integer (3 is used as an example, however students
may use any integer for the sum)
a2[] = {4, 5, 6, 7, 8, 9, 10, 11, 12, 6}
3.
Before
a3[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 3}
b3[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
After array a is copied to array b
a3[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 3}
b3[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 3}
4.
Before
a4[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 3}
b4[] = {10, 10, 10, 10, 10, 10, 10, 10, 10, 10}
After the arrays are added and stored in array c
a4[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 3}
b4[] = {10, 10, 10, 10, 10, 10, 10, 10, 10, 10}
c4[] = {11, 12, 13, 14, 15, 16, 17, 18, 19, 13}
5.
Before
a5[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 3}
b5[] = {10, 10, 10, 10, 10, 10, 10, 10, 10, 10}
After the arrays are multipled and stored in array c
a5[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 3}
b5[] = {10, 10, 10, 10, 10, 10, 10, 10, 10, 10}
c5[] = {10, 20, 30, 40, 50, 60, 70, 60, 90, 30}
6.
Before
a6[] = {1, 2, 3, 4, 5}
b6[] = {6, 7, 8, 9, 10}
After the arrays are invert-multiplied and stored in array c
a6[] = {1, 2, 3, 4, 5}
b6[] = {6, 7, 8, 9, 10}
c6[] = {10, 18, 24, 28, 30}
7.
Before
a7[] = {1, 2, 3, 4, 5}
After the array is reversed
a7[] = {5, 4, 3, 2, 1}
8.
(Prints any 10 random ints in an array)
lab4_q1.txt
Student writes 2-3 paragraphs stating pros and cons to using arrays and structs 5 5
An example is given of each (array and struct) 5 5
lab4_q2.c
Enum must look like this: 8 8
enum color
{
RED=18 , ORANGE , YELLOW=5 , GREEN , BLUE , INDIGO=14 , VIOLET
};
lab4_q2.script 2 2
Output is:
RED = 18
ORANGE = 19
YELLOW = 5
GREEN = 6
BLUE = 7
INDIGO = 14
VIOLET = 15
array_struct.c
Student wrote the body of the fill_array() function to match the prototype found 4 4
in the array_struct.h file
Student wrote the following functions that all return the index: (names don’t 8 8
matter) (2 points each)
◦ find min of ages
◦ find min of heights
◦ find max of ages
◦ find max of heights
Student wrote the following functions that return the average: (2 points each) 8 8
◦ find average age
◦ find average height
Student wrote function to print an individual structure, returns nothing 2 2
array_struct.script
Student prints out each structure that corresponds to the min age, the max age, 8 8
the min height, and the max height
Student prints out the average age and the average height 2 2
Student uses data in the array_struct.c file 3 3
Comments:
vector script show code not working. :(
For q1.txt, I would also mention that array’s imply sequence.
Let’s talk about long lines.
We can really clean up your zodiac. How?