Workbook 2.3
From the Java-Bootcamp-Resources
, launch the Workbook 2.3
folder.
The Apple Store
The workbook starts with three variables.
int numOfApples = 0; int numOfCustomers = 0; double profit = 0;
Task 1
Decrease your number of apples based on the printed messages.
Task 2
Increase your number of customers based on the printed messages.
Task 3
Make a price
variable and set it equal to 0.40
.
Increase your profits based on the number of apples sold, and the price of each apple.
Task 4
Replace each placeholder with a variable.
Result
>> Wow! So far, you made: $89.6
>> 3 customers love your apples.
>> You have 276 apples left. We'll sell more tomorrow!
Solution
The code solution is beside the starter project.
The video solution is inside the appendix (last section on Udemy).
Associated Course: The Complete Java Development Bootcamp
Related Course: The Complete Spring Boot Development Bootcamp – Become a Java Web Developer
Feedback Summary
4.7
43 students
5
91%
4
2%
3
0%
2
0%
1
7%
Written Reviews
There are no written reviews yet.