Lab 9
- Due No Due Date
- Points 10
- Submitting a file upload
- File Types cpp
This lab will be another series of exercises with loops before we take on the midterm. You can complete this lab before I even start this week's lecture.
Friendly reminder: You are NOT allowed to break or continue loops! By extension, you're also not allowed to use return 0 within loops to break them either. Focus on designing proper loops that don't require you to poke a bunch of holes in them to get your program to work. Use clearly defined logic statements that another programmer can read at a glance and immediately comprehend.
For the first problem, you are expected to use loops. The string() function is not allowed (but you will need string variables). That is, you ARE allowed to use functions from the string library like length(), but you're not allowed to use the actual function that happens to share the same name as the variable type itself.
For the second problem, you will need to perform an input check on top of the actual prime number check. This input check needs to happen ON REPEAT for all invalid inputs.
For the third problem, start by identifying where repeats happen, as there are two numeric patterns to uncover. You'll need to think about the problem in a formulaic approach. Considering that the only input into this program is the number of rows, how can this number be used to inform what happens on each row?
Rubric
Criteria | Ratings | Pts | |
---|---|---|---|
text_wrap.cpp
threshold:
pts
|
pts
--
|
||
prime.cpp
threshold:
pts
|
pts
--
|
||
pyramid.cpp
threshold:
pts
|
pts
--
|
||
Total Points:
10
out of 10
|