Quiz 1 Worksheet - Object-Oriented Programming I | CMSC 131, Quizzes of Computer Science

Material Type: Quiz; Class: OBJECT-ORIENTED PROG I; Subject: Computer Science; University: University of Maryland; Term: Unknown 2005;

Typology: Quizzes

2019/2020

Uploaded on 11/25/2020

koofers-user-cst-1
koofers-user-cst-1 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CMSC 131 Summer 2005 Quiz 1 Worksheet
The first Quiz of the course will be on Friday June 10. The following bullet list provides
more information about the quiz:
You will have 15 minutes to complete the quiz.
It will be a written quiz (not using any computer).
It will be a closed book, closed notebook, no calculator quiz.
You should be able to write a complete Java class.
You must use a pencil to complete the quiz
The quiz will be based on the exercises you will find below. Iteration statements
(do whiles/whiles) will not be part of the quiz.
The following exercises cover the material you are expected to be familiar for Quiz #1,
Solutions to these exercises will not be provided but you are welcome to discuss your
solutions with TAs and instructors during office hours.
1. From Lewis & Loftus
a. Page 55,56 (“Programming Projects section”): 1.1, 1.3
b. Page 107 (“Exercises”): 2.2, 2.6 (a, b, c, d, e, f, g, n, o, p, q)
c. Page 123 (“Programming Projects”): 2.2, 2.3, 2.5
d. Page 277 (“Exercises”) 5.14, 5.16
2. Write a Java program that computes the letter grade associated with student based
on a numeric grade value. The program will read the numeric grade of the student
and will compute a letter grade using the following cutoff values:
Letter Grade Cutoff
A 90.0
B 80.0
C 70.0
D 60.0
Any student with a numeric grade value lower than 60.0 will have F as letter
grade.
pf3

Partial preview of the text

Download Quiz 1 Worksheet - Object-Oriented Programming I | CMSC 131 and more Quizzes Computer Science in PDF only on Docsity!

CMSC 131 Summer 2005 Quiz 1 Worksheet The first Quiz of the course will be on Friday June 10. The following bullet list provides more information about the quiz:

  • You will have 15 minutes to complete the quiz.
  • It will be a written quiz (not using any computer).
  • It will be a closed book, closed notebook, no calculator quiz.
  • You should be able to write a complete Java class.
  • You must use a pencil to complete the quiz
  • The quiz will be based on the exercises you will find below. Iteration statements (do whiles/whiles) will not be part of the quiz. The following exercises cover the material you are expected to be familiar for Quiz #1, Solutions to these exercises will not be provided but you are welcome to discuss your solutions with TAs and instructors during office hours. 1. From Lewis & Loftus a. Page 55,56 (“Programming Projects section”): 1.1, 1. b. Page 107 (“Exercises”): 2.2, 2.6 (a, b, c, d, e, f, g, n, o, p, q) c. Page 123 (“Programming Projects”): 2.2, 2.3, 2. d. Page 277 (“Exercises”) 5.14, 5. 2. Write a Java program that computes the letter grade associated with student based on a numeric grade value. The program will read the numeric grade of the student and will compute a letter grade using the following cutoff values: Letter Grade Cutoff A 90. B 80. C 70. D 60. Any student with a numeric grade value lower than 60.0 will have F as letter grade.

3. The solution to this problem has been provided at the end. This problem is last semester’s quiz. Write a complete Java program that implements a currency converter. The program will convert dollars to euros. The program’s specifications are: - The program will read the exchange rate from dollars to euros. In other words, how may euros you will get for one dollar. Display the message “Enter Rate” to enter this value. - The program will read the amount in dollars you want to convert to euros. Use the message “Enter dollars” to enter this value. - To convert dollars to euros multiply the exchange rate by the number of dollars. - The program will print the message: "Equivalency in Euros: " followed by the amount in euros. The name of the Java class will be Converter. - You must use JOptionPane for input and output operations. - Use variables of type double to keep track of the exchange rate and the number of dollars. - The name of the Java class will be Converter. 4. The solution to this problem has been provided at the end. Write a Java program that prompts the user for two values, computes the average of the values and generates a message based on the computed average. The message “Satisfactory” will be output if the average is greater or equal to 70.0 and “Unsatisfactory” otherwise. The following restrictions/assumptions apply to this problem: - The name of the class you will define is ComputeStatus. - The input values are floating point values. You may use any of the Java floating point types. - Input and output operations must be completed using methods associated with JOptionPane. - You do not need to provide comments, however, you must use meaningful variable names and good indentation. - You must write any necessary import statements. - Write the program on the next page.