Algorithm that captures a person's age and determines how much they have to pay for a movie ticket. Entrance is free for people aged 5 and under and for people 100 and over. Those between 6 and 17 pay $ 3, those between 18 and 64 pay $ 8 and others $ 5.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
How to write this Code in the C# programming language explain in detail
Variables:
age : integer
price : real
begin
2. read ("Enter the age of the customer ")
write (age)
3. if (age <= 5 or age >= 100)
......then price ← 0
.......else if (age < 18)
.................... then price ← 3
....................else if (age < 65 )
................................then prix ← 8
................................else prix ← 5
.............................. end if
................ end if
end if
4. read ("The ticket price is:", price )
5. end
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images