Practice Control Structures - 4.7 | Chapter 4: Programming in Java | ICSE Class 12 Computer Science
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

Control Structures

4.7 - Control Structures

Enroll to start learning

You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

Write an if statement that prints 'High score' if score > 100.

💡 Hint: Remember the structure of an if statement.

Question 2 Easy

Create an if-else statement that prints 'Adult' if age > 18, otherwise 'Minor'.

💡 Hint: What will be printed if age is 18 or less?

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What does the if statement do?

Executes code regardless of condition
Executes code only if the condition is true
Executes code if the condition is false

💡 Hint: Think about under what circumstances will the code run.

Question 2

Which loop guarantees at least one execution of its code block?

for loop
while loop
do-while loop

💡 Hint: Consider the structure of each loop type.

1 more question available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Write a program that takes a student's marks and prints 'Excellent' for marks above 80, 'Good' for 60 to 80, 'Satisfactory' for 40 to 60, and 'Failed' below 40 using switch-case.

💡 Hint: Remember to divide marks by 10 to categorize them into ranges.

Challenge 2 Hard

Create a program using a while loop that reads and sums numbers until the user enters 0, then prints the total sum.

💡 Hint: You’ll need to initialize your sum value before starting the loop.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.