Docsity

Quiz 1 for Object-Oriented Programming II | CMSC 131, Quizzes of Computer Science

Toggle sidebar
bg1
CMSC131 Spring 2005, Quiz #1, Duration 15 Minutes
First Name: Last Name:
Student Id: Section: TAs:
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.
WRITE YOUR ANSWER ON THE NEXT PAGE.
pf3

Partial preview of the text

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

CMSC131 Spring 2005, Quiz #1, Duration 15 Minutes

First Name: Last Name: Student Id: Section: TAs:

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.

WRITE YOUR ANSWER ON THE NEXT PAGE.