Java Reference
In-Depth Information
To Start TextPad and Save a TextPad Document
1. Start TextPad following the steps outlined on page 53. If necessary, click
View on the menu bar and then click Line Numbers on the View menu
to display line numbers.
2. Insert the Data Disk in drive A. Click File on the menu bar and then click
Save As on the File menu.
3. When the Save As dialog box is displayed, type Commission in the File
name text box and then click Java (*.java) in the Save as type list. Click
the Save in box arrow and then click 3 1 2 Floppy (A:) in the Save in list.
4. Double-click the Chapter04 folder
or a location specified by your
instructor.
TextPad will save the file named
Commission.java as a Java source
code file in the Chapter04 folder
on the Data Disk in drive A
(Figure 4-5). Your list of files may
differ.
Save As
dialog box
Chapter04
folder
Java (*.java)
file type
Save
button
file name
FIGURE 4-5
5. Click the Save button in the Save As dialog box.
OTHER WAYS
1. To start TextPad,
click Start button,
click TextPad on
Start menu
2. To view line
numbers, press
CTRL + Q , L
3. To save, press F 12
4. To save, press
ALT + F , A
Coding the Program
As you have learned, the implementation phase of the program development
cycle involves writing the code that translates the design into a program. During
program design, a flowchart and pseudocode were used to outline the logic of
the program code used in the Commission program (Figure 4-4 on page 222).
As outlined in that pseudocode, the tasks that the program should perform are
to accept two inputs of sales amount and commission code, determine which
commission code the user selected, calculate commission using the appropriate
formula, and then display the commission as formatted output. The coding
process starts with entering the beginning program code.
Search WWH ::




Custom Search