You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ENGLISH (google translate)
The story I produced is nothing more than an account of an imaginary man who went on a diet for a year after reaching 150kg. Obviously I am not a dietician, so I do not recommend everyone to imitate what is written in the story, as it is all made up. The aim of the story was not to propose a lifestyle, but to make people realize that with perseverance and determination you can do anything.
As soon as the program has started, an output appears on the screen to introduce everything.
After these we go inside a "for" loop where the counter variable "i" which was initially 0, which represents the days of the year, increases each time the loop is executed.
If "i =" 1 "then a speech for the first day of the year will appear on the screen. (In the case of the first day of the year, Easter, Halloween, Birthday, Christmas and New Year the speeches are fixed)
If "i" is not the same as the above cases then the situation is different: in fact if "i" represents a Saturday or a Sunday then "i" + day will appear on the screen (so as to indicate what day of the year it is), and subsequently the execution of the main program is interrupted and the "weekend" subroutine is passed.
From the "weekend" subroutine, you immediately pass to another "festive_casual" subroutine which, through the srand () function, inserted inside a "while" loop, which prevents two identical days in a row, generates a random number between 1 and 6 which will be returned to the weekend subroutine, and depending on the number issued, a speech will correspond.
If "i" is not even a weekend day then it proceeds in a practically identical way as for the weekend but with different phrases.
The "for" cycle I was talking about at the beginning will repeat itself for 365 days and then stop.
ENGLISH (google translate)
The story I produced is nothing more than an account of an imaginary man who went on a diet for a year after reaching 150kg. Obviously I am not a dietician, so I do not recommend everyone to imitate what is written in the story, as it is all made up. The aim of the story was not to propose a lifestyle, but to make people realize that with perseverance and determination you can do anything.
As soon as the program has started, an output appears on the screen to introduce everything.
After these we go inside a "for" loop where the counter variable "i" which was initially 0, which represents the days of the year, increases each time the loop is executed.
If "i =" 1 "then a speech for the first day of the year will appear on the screen. (In the case of the first day of the year, Easter, Halloween, Birthday, Christmas and New Year the speeches are fixed)
If "i" is not the same as the above cases then the situation is different: in fact if "i" represents a Saturday or a Sunday then "i" + day will appear on the screen (so as to indicate what day of the year it is), and subsequently the execution of the main program is interrupted and the "weekend" subroutine is passed.
From the "weekend" subroutine, you immediately pass to another "festive_casual" subroutine which, through the srand () function, inserted inside a "while" loop, which prevents two identical days in a row, generates a random number between 1 and 6 which will be returned to the weekend subroutine, and depending on the number issued, a speech will correspond.
If "i" is not even a weekend day then it proceeds in a practically identical way as for the weekend but with different phrases.
The "for" cycle I was talking about at the beginning will repeat itself for 365 days and then stop.
Andrea Moramarco 11/30/21
You can see the code here: https://github.com/Andremora004/Progetti.git
The text was updated successfully, but these errors were encountered: