Introduction
This lab asks you to run through a few exercises similar to those we did in class. The trick now is that you need to type it all in, get it running, and submit it yourself. We'll discuss how to turn it in during class on Friday.
The Assignment
Please write a simple program that performs each of the following tasks in the same order as below:
- Declares three integers, a, b, and c.
- Assigns 5 to a and 10 to b
- Adds the two, storing the result in c.
- Prints the result.
- Declares three numbers w/fractions, d, e, and f.
- Assigns 3.5 to d and 4.6 to e
- Adds the two, storing the result in f.
- Prints the result.
- Adds a (from earlier) to d from earlier, storing the result in b.
- Prints the result.
- Declares a String s and assigns it a reference to the String "Hello world".
- Uses the toUpperCase() method to print out "HELLO WORLD"
- Uses the toLowerCase() method to print out "hello world"
- Uses the substring() method to print out "Hello"
- Uses the substring() method to print out "World"
We'll talk about this on Friday.