Here is today's queue for the ride. Tell me how many people
are waiting, who is first, and who is last, so I know where
to put the "line ends here" sign. The list changes every
hour, so do not count it yourself.
Write your requirements list before you write any code. Input, calculate, output, and anything you had to decide for yourself.
Notes
Put the names in an array in your code, in line order: Avery, Blake, Casey, Dakota, Emery, Finley. You do not need to ask for them.
“Do not count it yourself” is the whole challenge. The number 6 should not appear anywhere in your program — the array knows its own length.
The last person is not at index 6. Activity 1.24's deck has a slide named for the line that finds them.
Test it the way the person would use it: add a seventh name, run it again, and change nothing else. Then take a name away.
Where to Start
Only one-star challenges have this section. If you already know how to begin, skip it — and when you move up to two stars, working out the order yourself is part of the job.
Write the array of six names.
Print how many are waiting, using the array's .Length.
Print the first person. Their index is the same for every queue.
Print the last person without typing their index.
Add a name to the end of the array and run it again. Every line should still be right.
Sample Output
Sample Output
6 people are waiting.
First in line: Avery
Last in line: Finley
Verified in a real run. With a seventh name added, the first line says 7 and the last line names the new person, with no other change.
Submit
Your requirements list and your program file, named cc-last-in-line.