Ask Question
20 September, 01:54

The short-term, 0-24 hours, parking fee, F, at an international airport is given by the following formula:  5, if 0 # h # 3 F5  63int (h11), if3, h#9   6 0, i f 9, h # 2 4 where int (h + 1) is the integer value of h + 1. For example, int (3.2) = 3, int (4.8) = 4. Write a program that prompts the user to enter the num - ber of hours a car is parked at the airport and outputs the parking fee.

+1
Answers (1)
  1. 20 September, 02:48
    0
    The following code will program that prompts the user to enter the num - ber of hours a car is parked at the airport and outputs the parking fee.

    Explanation:

    Code:

    #include

    using namespace std;

    int main ()

    {

    float hours;

    cout <<"Enter number of hours a car parked at the airport: "; / / prompt the user to enter hours.

    cin >> hours; / / strong the hours

    if (hours > = 0 && hours < = 3) / / if 0 < = h < = 3

    cout << "Parking fee: 5"; / /printing parking fee is 5.

    else if (hours > 3 && hours < = 9) / /if 3 < h < = 9

    cout<<"Parking fee: "<<6*int (hours); //converting float value to int the multiplying with 6 then printing fee.

    else//if 9 < h < = 24

    cout<< "Parking fee: 60"; / / printing parking fee 60.

    return 0;

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “The short-term, 0-24 hours, parking fee, F, at an international airport is given by the following formula:  5, if 0 # h # 3 ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers