Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

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

Material Type: Quiz; Professor: Padua-Perez; Class: OBJECT-ORIENTED PROG I; Subject: Computer Science; University: University of Maryland; Term: Unknown 1989;

Typology: Quizzes

Pre 2010

Uploaded on 02/13/2009

koofers-user-hud
koofers-user-hud 🇺🇸

10 documents

1 / 3

Toggle sidebar

Related documents


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.

WRITE YOUR SOLUTION ON THIS PAGE.