Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Mint yr:2013 Create a pseudocode for a program The following is an outline of wh

ID: 3877204 • Letter: M

Question

Mint yr:2013

Create a pseudocode for a program

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

Label L

print "Enter mint year"

input mint_year

if year = 0

print "Good bye"

return

endif

else if year < 1909 OR year > 2017

print "Try again"

goto L

else

count[] = {0} // will store the count of years with sum of digits = count[i]

for i = mint_year to 2017

age := i - mint_year

temp := i, sum := 0

while temp > 0

sum := sum + temp mod 10

temp := temp/10

endwhile

count [sum] := count[sum] + 1

print " The age is (i) age of the coin is (age), sum is (sum)"

endfor

n := 1

while n < 2 and n > 28 and n!=0

print "enter a no from 2 to 28"

input n

if(n>=2 and n<=28)

print count(n)

endif

endwhile