Java Reference
In-Depth Information
1 /*
2
Chapter 3: The Body Mass Index Calculator
3
Programmer: J. Starks
4
Date:
October 20, 2007
5
Filename:
BodyMass.java
6
Purpose:
This project calculates the body mass index based
7
on a person's height and weight.
8 */
9
10 import java.io.*;
11
12 public class BodyMass
13 {
14
public static void main ( String [] args ) throws IOException
15
{
FIGURE 3-7
The following step enters beginning code in the coding window.
To Enter Beginning Code
1. With the insertion point on line 1 in the coding window, type the code
as shown in Figure 3-7. In the comment header, insert your own name
as the programmer and enter the current date.
TextPad displays the beginning code in the coding window (Figure 3-8). The
insertion point displays after the opening brace on line 15.
comment
header
import statement
class
header
main() method
header
opening
brace for
class
throws IOException
code
opening brace
for main()
method
FIGURE 3-8
 
Search WWH ::




Custom Search