- Write a Logo procedure third :alist to output the 3rd
item in a
list. If the number of items in the list is less than three, it
should
just output the last item. Write similar procedures for 4th and
5th
items. (You should use the built-in procedure “count” which
outputs
the number of things in a list).
- Write a Logo procedure convert :agrade which takes
a
letter (A,
B, C, D, or F) and outputs a number (4, 3, 2, 1, 0).
- Write a Logo program to process student GPAs.The input is
the
person's
name (a list of up to 3 words) and the person's grades (five separate
requests)
for the last semester. For the name, you should not just write make "name readlist. Instead
write a getname procedure
that outputs a name only when it contains fewer than 4 words, and use make "name getname. You may assume
that there are exactly five
grades. You should, however, make sure that each grade is either
A, B, C, D or F using a getgrade procedure instead of just
using read. For example: make "gr1 getgrade make "gr2
getgrade etc.
The program should print out on the graphics screen: a nice
colorful
creative:
Welcome to Stonehill "person's first name".
Your grades for last semester were: ...
Your grade point average is: ...
Use procedures to help make your program simple to understand. In
particular,
a procedure average :num1 :num2 :num3 :num4 :num5 will be
useful,
as well as the procedure convert :agrade from problem
2. For example: the last line of yoru program should
be something like:
(tt [Your grade point average is:] (average
(convert :gr1) (convert :gr2) (convert :gr3) (convert :gr4)
(convert :gr5)) )
- Write a program that computes the GPA of a bunch of grades where
you do
NOT assume that there will be just 5 grades. You should ask the
person how many grades there will be, and store the
answer in “num_grades. Then using repeat :num_grades [ ...], have
the program repeatedly read a new score, and add it to a
variable
“sum. At the end, you should divide :sum by :numgrades to print
the average. Note that with this modification,