Tags:
view all tags
---+Color Frequency Counter ---++ Objectives 1. Learn about arrays ---++ Assignment 1. Create a clean program that will count the number of occurrences of each color and display the result on the screen. The idea is that each "pixel" is a color. Your robot is to go in a line counting the number of pixels of each color and then output the counts of each. Your robot should stop when it touches a "wall". a. Each pixel will be about one inch square. a. Pixels of the same color may be next to each other. ---++Suggestions a. Start just by counting the number of times you encounter one specific color. This can be done without an array and will get you started. a. Then create seven variables (one for each color) and do it for all colors a. Then use an array with just one element. Use black (index of 1) and just count the number of times you encounter black. a. Then add blue to your colors and two elements in the array a. Finally make it so that your array has seven elements (one for each color) a. Stop when you touch something 1. Additional requirements a. The final version must use an array to store the counts for each color ---++ Submission instructions 1 Due date is found on Canvas 1 Each person should create a pdf document that contains the following information a. Your name a. Your partner's name a. A brief description of what you did a. A brief description of what your partner did a. How your team improved over any mistakes made last time a. Indicate which hints (if any) your team used a. How well you achieve each objective. 1. Create one zip folder for the team a. place your code (making sure it has a comment that includes the lab assignment and the name of all team members) a. place each member's pdf in the folder 1. Have one team member submit it in canvas. ---++ Hints 1. [[CSC102F2022Lab7HintInit][Essential when setting up an array]] 1. [[CSC102F2022Lab7HintColor][Converting a color to an index]] ---++ Challenges 1. Have the robot speak the color and counts 1. Have the robot speak or display the color with the largest number of occurrences. If there is a tie, just output the first one
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r2 - 2022-08-23
-
cathybareiss
Home
Site map
Assessment web
BethelAIResources2026 web
CenterForComputing web
ChatGPT web
Intro2AIatBethel web
Main web
Sandbox web
TWiki web
CenterForComputing Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
Edit
Attach
Copyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback