Professional Documents
Culture Documents
Instructions
1. Create a program with the filename PrintConsole.java.
Note: filename and class name must be the same.
2. Write the print statements to display output.
In this task, you’ll write a simple program which will generate the following output.
Output
Programming is great fun! I can’t get enough of it.
Instructions
1. Create a program with the filename HelloProgramming.java.
Note: filename and class name must be the same.
2. Write the print statements to display output.
Note that both messages are on separate lines.
Task #3: Writing on the console using Escape Sequences
In this task, you will write a program which will generate the following output using escape
sequences.
Sample Output
School of Electrical Engineering and Computer Science (SEAS) offers:
1. BS Computer Science
2. BS Software Engineering
3. BS Data Science
4. BS Computational Mathematics
5. Associate Degree in Computer Science
Instructions
1. Create a program with the filename EscapeSequences.java.
Note: filename and class name must be the same.
2. Write the print statements with proper escape sequence to display output.
Sample Output
Following are our most enrolled elective courses:
Web Development
Web Application Development
Mobile Computing
Android Application Development
Instructions
1. Create a program with the filename NewAndTab.java.
Note: filename and class name must be the same.
2. Write the print statements with proper escape sequences to display output.
Babar bought a camera for Rs. 370 and sold the same camera for Rs. 458. Now, Babar wants to find if he has
made a profit or loss.
We know that a Boolean Expression’s result is either true or false. The truth table for all three operators is
shown below.
Now, assume that a = 2, b = 4 and c = 6. Determine the value of each expression given below as true or
false.
1. a == 4 || b > 2
2. c >= 6 && a > 3
3. b != 1 && c != 3
4. a >= -1 || a <= b
5. !( a > 2 )
Task #1: Writing a while loop
In this task, you are being asked to write a loop in Java.