C++ ONLY 6.5.3: Functions with branches. CODE: #include using namespace std; /* Your code goes here */ int ma

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

C++ ONLY 6.5.3: Functions with branches. CODE: #include using namespace std; /* Your code goes here */ int ma

Post by answerhappygod »

C++ ONLY 6.5.3: Functions withbranches.
C Only 6 5 3 Functions With Branches Code Include Iostream Using Namespace Std Your Code Goes Here Int Ma 1
C Only 6 5 3 Functions With Branches Code Include Iostream Using Namespace Std Your Code Goes Here Int Ma 1 (14.28 KiB) Viewed 32 times
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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply