In this in-class activity. you will work in teams to create pseudocode for a pro
ID: 3888368 • Letter: I
Question
In this in-class activity. you will work in teams to create pseudocode for a program. Your pseudocode must STRICTLY FOLLOW the course Pseudocode Guidelines document. The following is an outline of what your program must do: Get the mint year of a Lincoln cent from the user. Make sure the program tells the user what it wants. If the year is 0, this means the user does not want to continue. In this case, tell the user goodbye and stop. If the year is less then 1909 or greater than 2017, tell the user to try again. Keep asking until you get a valid year or 0. For each year from the coin's mint through 2017, tell the user the following: the year, the age of the coin that year, and the sum of the digits of that year. Make sure you make this information clearly understandable for the user. Ask the user for a number between 2 and 28. If the user does not answer in this range, keep asking. The user can opt to quit here by entering 0. Display the number of years since the coin's mint that have a sum of digits equal to the number.Explanation / Answer
START
1. Print message - Enter mint year of Lincoln cent
2. Take Input Year
3. If Input Year == 0, goto 4, else goto 5
4. Print message - Goodbye, goto END
5. If Input Year < 1909 OR Input Year > 2017, goto 6, else goto 7.
6. Print message - Try again, goto 1.
7. Store Counter = 1
8. If (Input Year + Counter) is < 2017, goto 9, else goto 17
9. Print message - Year : Input Year + Counter
10. Print message - Age of coin : Counter
11. Print message - Sum of digits of this year: (Get each digit of Input Year and print the sum)
12. If Hashmap Key = Sum does not exist, goto 13, else goto 14.
13. Create Hashmap Key = Sum, Value = 0
14. At Hashmap Kay = Sum, Value = Previous Value + 1
15. Counter = Counter + 1
16. Goto 8
17. Print Message - Enter a number between 2 and 28
18. Take Input Number
19. If Input Number == 0, goto END
20. If Input Number < 2 OR Input Number > 28, goto 17, else goto 21.
21. Print Hashmap Value where Key = Input Number
22. END
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.