Next: The if-else Statement
Up: The if statement
Previous: Multiple Choice Questions
In each of these exercises produce an algorithmic description before proceeding to write the program.
Trip too short for accurate resultsis printed if the mileage used to calculate the fuel consumption is less than 100 miles.
x
and y
are
input will output the absolute difference of the two integers. That is
whichever one of (x-y)
or (y-x)
is positive. Think of
all the cases that can arise and consequently plan a set of test data
to confirm the correctness of your program.A student passes if all three examinations are passed. Additionally a student may pass if only one subject is failed and the overall average is greater than or equal to 50. The pass mark for an individual subject is 40.
Write a C++ program to implement this task.