Also add a brief description of the algorithm (what it does, the limitations of
ID: 3781420 • Letter: A
Question
Also add a brief description of the algorithm (what it does, the limitations of its effectiveness, all the assumptions you made even if the appear in the question). Variable names must be descriptive and every one of them must be declared and followed by a brief comment indicating its purpose (i.e: length - is the length of the box). Also add a brief description of the algorithm (what it does, the limitations of its effectiveness, all the assumptions you made even if the appear in the question). Variable names must be descriptive and every one of them must be declared and followed by a brief comment indicating its purpose (i.e: length - is the length of the box). (10 marks) Write an algorithm to determine if a person is the right age to be permitted into a bar in in Alberta (Note: You are supposed to be at least 18 years old to enter a bar in Alberta). First example of "running" the algorithm old are you? 16 You may not enter the bar. Second example of "running" the algorithm How old are you? 29 You may enter the bar.Explanation / Answer
Algorithm:
int Age;
print"How old are you?"
input "Age"
if(Age>=18)
print"you may enter the bar"
else
print"you may not enter the bar"
Description:
Age-age of the person
The program checks whether the age of the person is less than 18 if so then it displays the following statement
"You may not enter the bar"
If the persons age is equal to or greater than 18 then it displays the following
"You may enter the bar"
I hope the algorihtm is more effective and useful for the bar in Alberta
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.