1 / 2100%
Preparation:
1. If you will be using the computer in the lab, you will need your ASURITE ID to log into
the lab computer. Make sure you know your logon and password.
2. Know the syntax for a simple program like the examples from lecture and chapter 3.
3. Be familiar with the concept of if-statements.
To be completed in lab:
1. Either log on to a lab computer or use your own laptop.
2. Start either TextPad or Eclipse.
3. Write a program which gets a grade from the user and assigns it to one of the Excellent,
Good, Fair, And Poor categories according to the following table. Your program should
be able to ask the user his name and also ask him whether he wants to enter a number
or not. If the answer was yes, you need to get the grade from him and the categorized it,
otherwise you have to print the statement “Good Luckand then exit the program. If
the user enter something else other than yes/no you have to print “Wrong Input and
then exit the program. A sample input/output for your program is:
First Sample:
Please enter your name:
Joe Blue
Do you want to enter a grade? (Yes/No)
Yes
What is your grade?
87
Joe Blue, your grade is Good.
Second Sample:
Please enter your name:
Joe Blue
Do you want to enter a grade? (Yes/No)
No
Good Luck Joe Blue!
Third Sample:
Please enter your name:
Joe Blue
Do you want to enter a grade? (Yes/No)
Hello
Wrong Input Joe Blue!
CSE 110 Lab 3 (February 9 February 13)
90≤Grade≤100
80≤Grade<90
70≤Grade<80
Grade<70
Excellent
Good
Fair
Poor
4. When you are done, have your TA grade your results.
Powered by TCPDF (www.tcpdf.org)
Students also viewed