

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Exercise 5 Task 1 Print Numbers from 5 to 9 Let's implement a while loop that outputs numbers from 5 to 9 to the console. Task 2 Implement a for loop that outputs the word "Tiger" exactly 5 times. Task 3 Stop and Skip Implement a loop that skips even iterations and stops on the 5th iteration. Here are the instructions:
Task 5 Sum
You're provided with an object representing a car's details. Your task is to create a method within the object that calculates the car's total price. The car's total cost is calculated by adding the base price and the sum of additional options.