

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Quiz; Class: OBJECT-ORIENTED PROG I; Subject: Computer Science; University: University of Maryland; Term: Unknown 2005;
Typology: Quizzes
1 / 3
This page cannot be seen from the preview
Don't miss anything!


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:
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.