Spaces:
Running
Running
System.out.print("<some str no newline>");
Browse files
Week 1: Types, condition clauses and loops/3. Print the whole sentence
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Complete the following program body so that it prints the complete sentence:
|
| 3 |
+
Java-programming is surprisingly easy.
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
Note that the program has a print statement before and after the part of the program to be written.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
import java.util.Random;
|
| 11 |
+
|
| 12 |
+
public class Test{
|
| 13 |
+
public static void main(String[] args){
|
| 14 |
+
final Random r = new Random();
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
System.out.print("Java-programming");
|
| 18 |
+
|
| 19 |
+
System.out.print(" is surprisingly ");
|
| 20 |
+
|
| 21 |
+
System.out.println("easy.");
|
| 22 |
+
}
|
| 23 |
+
}
|