Hello friends and welcomes to my article once again in the SEC S20/W4 in this great task. I would be putting up my article properly. I do hope you enjoy my article.
Conditional Structure is a programming concept which involves execution of different programmed command based on principal conditional statement basically being true or false. The commonly used is the if-else
statement. The structure allows program perform different actions depending on any condition, thus have a crucial role in decision making.
Situation of everyday life of conditional structures
1. You intend to be punctual to work, you wake early and prepare yourself early too, to beat traffic as be punctual at work after all. Else you just have to rest and arrive work when you wish.
2. You making pasta for dinner , you make to a good boil for 10 minutes, sieve it for a sweet egg sauce, otherwise keep boiling until its done.
The above two conditional structures are based on decision making to suit your activities as you indeed will.
The room()
function starts by printing welcome and providing 2 options which are 1 and 2. Conditional statement `if-elif-else' checks whether user input is either option 1 or option 2 while showing message as stated earlier. This is there is an error, it would be definitely spotted in the code.
Coded Program
Coded Output Interpretation
This is the created program with about four inputs from the user with four grades. The average will tell us and display whether it is passed or needs to be improved . We check if average grade is more than 70 then get a message displayed. "The section passed." If it's average goes below 70 then the program displays "section can be improved."
passed section |
---|
improved section |
---|
Cc;
@alejos7ven
Upvoted. Thank You for sending some of your rewards to @null. It will make Steem stronger.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
can i ask, what application do you use .. @daprado1999 ...
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I used C++ Online IDE, to run most of the codes, thanks for stopping by and warm regards
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you. I guess I will give it a look. Good luck with the contest, and happy weekend.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit