Post date: Jan 22, 2020 4:1:52 AM
Getting Started
1.2 Expressions and Assignment Statements
1.3 The Class String
1.4 Comments
Interesting links:
Recommended Self-Test Exercises:
p 52: Ex. 10-16.
p 60-61: Ex. 17-21.
p 64-65: Ex. 22, 23.
p 77: Ex. 24-30, 32
Lab Exercise:
Ex: 1
Write a program that declares 3 real number variables N1, N2, and N3.
Save the result of N1 + N2 / N1 in the variable N3
Display the content of all the variable as shown below:
Ex: 2
Write a program that declares and initializes four variables and prints the following:
Their sum
Their difference
Their product
Their average
Your program should have an output similar to the one below:
Ex: 3
Write a program that initializes a String object to “Hello the World”, prints its length, then erases the word “the” from that String.
Ex 4:
Write a program that starts with a line of text and then outputs that line of text with the first occurrence of "hate" changed to "love" . For example, a possible sample output might be:
The line of text to be changed is:
I hate you.
I have rephrased that line to read:
I love you.
You can assume that the word "hate" occurs in the input. If the word "hate" occurs more than once in the line, your program will replace only the first occurrence of "hate".