Have a question?
Message sent Close

Is3230 online quiz City University of Hong Kong

Instructor
Kevin
Category
  • Description
  • Full Document

Week 2 & 3 (i.e. Java Fundamentals and Decision Structures).
Q1: What would be the value of bonus after the following statements are executed?
int bonus, sales = 1250;
if (sales > 1000)
bonus = 100;
if (sales > 750)
bonus = 50;
if (sales <= 500)
bonus = 25;
else
bonus = 0;
o 100
o 25
o 0
o 50
Q2. What will be the value of bonus after the following code is executed?
int bonus, sales = 10000;
if (sales < 5000)
bonus = 200;
else if (sales < 7500)
bonus = 500;
else if (sales < 10000)
bonus = 750;
else if (sales < 20000)
bonus = 1000;
else
bonus = 1250;
o 500
o 750
o 1000
o 1250
o 200

 

Preview

Is3230 online quiz City University of Hong Kong

Blur-Preview
Is3230 online quiz City University of Hong Kong
Category:
Share
Course details
Lectures 1
error: