. This assessment has a
.
QUESTION 1
[
5 Marks]
Write a C program that accepts 10 input integers. For
each input number, display an output message according to its value:
- Display message British Airways if the input value is 145
- Display message American Airlines if the input value is 245
- Display message Singapore Airlines if the input value is 345
- Display message Airline not recognized if the input value is not 145, 245 or 345
QUESTION 2
[
5 Marks]
In the same program as question 1, add a
function that
accepts an integer input and
returns the result based on the following formula:
output = ( input * 20 ) - input
For example, if the input integer was
145, then the
function would return
2755 and if the input integer was
45, then the
function would return
855.
QUESTION 3
[
5 Marks]
In the same program as question 1, add a
while loop to iterate through all 10 input integers and display the result of calling the
function written for question 2.
QUESTION 4
[
5 Marks]
In the same program as question 1, add a
for loop to iterate through all 10 input integers and find the
lowest number
and the
highest number. Display an output message to indicate both numbers.