
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
Instructions for an assignment in computer science 121 where students are required to create a java application with two classes. The main class initializes a person object and calls a method to calculate and display the person's body mass index. The person class contains data for name, weight in pounds, and height in feet and inches.
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

Computer Science 121 Assignment 2 Due: October 4, 1999 Create a Java application that has two classes, one containing the main method that starts the action and the other that describes a person. The data for this class should be a person's name, weight in pounds and height in feet and inches. Assign reasonable values for these in the constructor for the class. A second method should calculate and display the person's body mass index. To compute this, multiply the person's weight in pounds by 705. Then divide this result by the person's height in inches squared. For example, if the person weighs 120 pounds and is 5 feet 2 inches tall ( inches), his or her body mass index is (120 * 705) / (62 * 62) or 22. The main method should declare a person and then call the appropriate method to display the person's body mass index.