Threesuns

Email the Instructor

Contact

All Semesters

Semesters

All Courses

Courses

2012Spring

01.09.12 - 05.06.12

Introduction to Java Programming

CSCI2133

Monday Wednesday
04:00 PM - 05:20 PM

Planet Weight Calculator

Lab06

Objective: Use of Objects, Classes and GUI components

pastdue

Submit Your Solution

Lab06

Request a Copy of your Solution

Lab06

Requirements

Comments placed in each source code file. 5 pts
Files put into JAR format and is made executable.5 pts
Application source and class files included.5 pts
Program compiles and executes without errors5 pts
Program allows required user inputs20 pts
Program performed input error checking20 pts
Planet Images shown20 pts
Weight Calculated20 pts
Total100 pts

Instructions

Create an application that will calculate a persons weight on any planet in our solar system. (even through Pluto is not longer officially a planet, we will consider it one for this lab)

The information needed to calculate the weight is included in the file Planets.txt. The information in this file includes the names of the nine planets and the planets gravity as a percentage of Earth's gravity. To find a persons weight you only need to multiple their weight by the "percentage of earth weight" number in the planets.txt file. The persons weight should be accepted through a JTextField component and their calculated weight should be displayed in a JTextArea component. The user should be able to choose the planet they would like to see their weight for from a JComboBox. If a planet is selected in the JComboBox but no weight has been entered then a message dialog box should be displayed telling the user that their earth weight is require. The user should be able to trigger the weight calculation by either selecting a planet from the JComboBox or pressing enter in the JTextField.

Also, a picture of the selected planet should be displayed whenever a planet is selected from the JComboBox. The pictures of the planets can also be downloaded. To display the planet images you should use an ImagePanel object (we will create one in class). Earth should be the default picture as well as the default option in the JComboBox.

If the planet selected by the user is Pluto you should display a message in the JTextArea saying that there is not enough information available about Pluto to calculate their weight.

Example:

Extras