Java Bootcamp – Workbooks and Challenges
)}

Workbook 3.1

From Java-Bootcamp-Resources -> Module 1 -> 3. Booleans and Conditionals, open Workbook 3.1.

Ask Java!

You will develop an app called Ask Java. The user can ask questions and Java needs to reply: true or false.

Question 1.


Me: Hi Java, do I have enough change to buy chips?

You have 3.50 in change, and the price of chips is 2.50. Replace the placeholder with an appropriate comparison.

Java: " + ("<compare change and price>") + "\n

Question 2.


Me: Hi Java, can the elevator hold everyone?

There are 15 people, but the elevator can only hold 12. Replace the placeholder with an appropriate comparison.

"Java: " + ("<compare capacity and people>") + "\n"

Question 3.


Me: Hi Java, will my friend be happy?

Your friend wanted a PS5. But, you got them a toy car. Replace the placeholder with an appropriate comparison.

"Java: " + ("<compare request and purchase>") + "\n"

Question 4.


Me: Hi Java, can everyone attend my dinner party?

Java must check if you have enough space for every guest. Replace the placeholder with an apt comparison.

Java: " + "<compare space and guests>" + "\n

Question 5.


Me: Hi Java, will I win the election?

Java must check if you have more votes than your competitor.

Java: " + "<compare your votes and competitor>" + "\n

Run your code.


Good Luck!


Feedback Summary
4.8
39 students
5

92%
4

3%
3

0%
2

0%
1

5%
Written Reviews
There are no written reviews yet.