C++ ONLY 6.5.3: Functions withbranches.
CODE:
#include <iostream>using namespace std;
/* Your code goes here */
int main() { int numberOfVisits; int duration;
cin >> numberOfVisits; cin >> duration; cout << FindParkingPrice(numberOfVisits,duration) << endl;
return 0;}
Jump to level 1 Define a function FindParking Price that takes two integer parameters as the number of parking visits and the parking duration, and returns the daily parking price to be paid as an integer. The price is returned as follows: Visits <5 hrs 5-15 hrs > 15 hrs <= 6 7-16 >= 17 24 19 8 17 9 10 11 12 13 14 15 16} 14 6 12 Ex: If the input is 54, the output is: 19 11 1 #include <iostream> 2 using namespace std; 3 4 /* your code goes here */ 5 6 int main() { 7 5 int number of visits; int duration; 9 cin >> numberOfvisits; cin >> duration; cout << FindParking Price (numberOfvisits, duration) << endl; return 0; 2
C++ ONLY 6.5.3: Functions with branches. CODE: #include using namespace std; /* Your code goes here */ int ma
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am