Page 90 - Viva ICSE Computer Studies 8 : E-book
P. 90
2. int i = 1;
do
{
System.out println (i);
i++
}
While (i < = 9); _____________________________
D. Name the following.
1. A loop similar to While loop, which is guaranteed to execute at least
one time _____________
2. A loop that executes a target statement as long as a given condition is true _____________
3. A process of executing a block of statements again and again _____________
4. Three conditional control structures _____________ _____________ _____________
5. The simplest control structure _____________
E. Answer the following questions.
1. What is a loop? Explain its various parts.
2. Write the diff erence between For loop and While loop.
3. Explain If Else If ladder with the syntax and an example.
4. Explain Switch case with the syntax and an example.
5. Diff erentiate between If statement and If Else statement.
Building Values and Life Skills
Sheena is writing a program to test multiple conditions like marks > 80 = Distinction, Marks > 70 =
First class, Marks > 50 = ’Second class‘. Suggest her the control selection to be used in the program.
Testing Knowledge
Think about the variables that you will use to develop a program for your school result system. Name
the variables.
Linking Knowledge
Mathematics: Write a Java program to perform arithmetic operations between two numbers.
Lab Fun
1. Write a program to print the largest of three numbers.
2. Write a program to accept a number from the user and print the corresponding colour of the
(RGB), for example, 1 = Red, 2 = Green, 3 = Blue.
78