Title | Lab 7 - CCVVC |
---|---|
Author | Muhannad Al Balushi |
Course | Programming |
Institution | جامعة السلطان قابوس |
Pages | 2 |
File Size | 130.3 KB |
File Type | |
Total Downloads | 59 |
Total Views | 141 |
CCVVC...
©Hafedh AlShihi
Sultan Qaboos University Department of Information Systems College of Economics and Political Science INFS3410: Fundamentals of Programming in Business Fall 2021 Lab 7 (Ch3 – 2) Estimated completion time: 90 minutes Previous Homework Use counters 🤔
Nested if and if-else Statements Syntax if (boolean-expression) Statement(s); }
{
else if (boolean-expression) Statement(s); }
{
else if (boolean-expression) Statement(s); }
{
else
{ Statement(s);
}
What if more than one boolean-expression is true ? Is it a must to have an else statement at the end? What is the maximum else if statements we can have? Lab 7 INFS3410 – Fall 2021
©Hafedh AlShihi
Generating Random Numbers Use the following formula to generate any random number between a and b (int)(Math.random() * (b – a + 1) + a) Write a java program that generate random numbers between 10 and 100 Write an addition test program for kids. The program should display 3 random questions for kids every time.
Homework: Write a java program that can examine school children on multiplication. The kid has to select which multiplication table he wants to be tested in. o Display 10 random questions every time, o Display whether the answers are right or wrong, o Show the correct answers for wrong answers and o calculate the total score (out of 10) Read sections 3.10, 3.13, 3.14 and 3.15
Lab 7 INFS3410 – Fall 2021...