Quick Index
Overview
For this problem we will use the code provided in the full example.
As always, this challenge follows the full example closely.
Steps:
- Download the file "DeclaringVariables.java" and place into a new working directory
- Edit it for this challenge per the problems below.
- The following problem write-ups all apply to "DeclaringVariables.java"
Declarations #1
- Find the tag "//Declarations #1"
- Replace the two existing declarations with two of your own (the existing declarations show you the pattern you can follow)
- For data types, choose between "int/String/boolean/double"
- For variable names, use any names you like but follow the guidelines/conventions below
Declarations #2
- Find the tag "//Declarations #2"
- Same steps as "Declarations #1" but declare two other variables using any of the four possible data types.
Declarations #3
In previous challenges you coded two new types (classes):
We will use these for the declarations here.
- Find the tag "//Declarations #3"
- Replace the two existing declarations with two of your own.
- For data type, for one declaration use data type "Ball" and the other use "Rectangle"
- For variable names, use any names you like
NOTE WELL -- you will have to copy Ball.java and Rectangle.java (your previous work) into the working directory you are using for this challenge.
Compile
Steps:
- Compile the JAVA file
- Fix any compile errors
- Iterate steps 1 and 2 until you have a "clean compile" (no compile errors)
This is a compile-only challenge. You do not need to run any code.