Lesson 6Pulling It All Together: Building a Useful Program

Now, let's pull everything we've learned together and build our first useful program. The purpose of the program is to calculate the total cost for home replacement windows. Here are the requirements:

PLANNING THE PROGRAM

Before you boot up your IDE and start to write the code, you should always take time to plan any program you will write. This includes identifying any variables your program will need and how the variables are related to each other, as well as using pseudocode or a flowchart (or both) to identify the steps your program will need to complete.

Identifying the Variables

Looking through the requirements list, we will need the following variables:

  • String variable for height (read from console)
  • String variable for width (read from console)
  • Float variable for height (converted from string; use ...

Get Job Ready Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.