Question: LAB 1-ARRAYS (Max Grade 110pts) 1. (0pts) Create a constant and assign a color to it -the color should be a string. a. Example: red
LAB 1-ARRAYS (Max Grade 110pts) 1. (0pts) Create a constant and assign a color to it -the color should be a string. a. Example: red (20pts) Create an array of elements and instantiate the array with colors-5 or more colors. 2. Example: (red, orange, green, black, yellow, brown) a. (50pts) Use a loop to iterate through the array and check each color to see if it matches the color of your constant. 3. 4. (20pts) Print a message to the console a. If a color matches the constant Print "Found a match at position X in the array"- X must be the actual position in the array b. If there are no matches in the array Print "No colors match" (10pts EXTRA) Account for multiple matches and indicate how many matches there are and at what positions in a single statement in the console 5. Example: Constant: red Arrayfred, green, red, orange, red, black, red, red) Output: There were 5 color matches at positions 0,2,4,6,7 in the array a. b. SUBMISSION DETAILS Format: Lab MUST be written in a single PLAYGROUND project Medium: Lab MUST be submitted to BLACKBOARD
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
