![]()
Chapter 9: Let's create our first programs together
To practice a little more before the final test and to re-appropriate everything we have seen so far, we will create two fairly basic programs. The first will be very easy but the second a little bit harder. 👺
Here we go! 😃
Program 1: Baggage labeling |
|
You will program an automatic baggage tagging software for the new Meruvia Airport. The program will ask the user to enter the number of bags to tag as an integer (int). Example result for 4 bags: MERUVIA – Checked Baggage No. 00 |
Program 2: AI Dealer |
|
Meruvia's new Casino Royale asks you to design a program that rolls dice randomly, without cheating of course! 🙃 You will use the following code to generate a random number:
You will ask the user to enter an integer (int) which will be the maximum value of your dice roll (you will therefore have to change this 99 for a variable...). You will roll the dice with the above function and display the value. Finally, you will put this program in a while loop asking on each turn if the user wants to continue rolling the dice. Otherwise you will exit the program. Good luck! 😇 |
There you go, I'll let you think about it a bit and we'll see you in the next chapter for the correction! 😀
See you soon for the rest! ☺️

English
Français