Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i want UML DIAGRAM for this program: #include using namespace std; class parkingnCharges{ private: double hours, tHours; //copy of hours to used for calculation double

i want UML DIAGRAM for this program:

#include using namespace std;

class parkingnCharges{

private: double hours, tHours; //copy of "hours" to used for calculation double addition_per_hr = 0.50; //if hours is more than 3 hours,then add .50$ per hour. double charge;

double minimum_charge = 2.00 //minimum charge for up to 3 hrs , maximum_charge = 10.00; //maximum charge for 24 hrs

public:

void getHours(){ unsigned long int hrs, min; //to get and cnvert the hours cout << "please enter the hours you want to park: hour then minute "; cin >> hrs;

cout << "\b\b:"; cin >> min; cout << endl; // hours = hrs + (min > 0 ? min = 1 : min = 0); tHours = hours; }

void calculateCharges(){

if (tHours <= 3){ charge = minimum_charge; }

else if (tHours > 3 && hours < 24){ tHours -= 3; charge = minimum_charge + (tHours * addition_per_hr); }

else if (hours = 24){ charge = maximum_charge; } }

void printing(){ cout << "The fee charged for " << hours << " is " << charge << endl << endl;

} };

int main(){

//making an object parkingnCharges ob; parkingnCharges ob1, ob2, ob3; //first and secound and third person

//calculating ob1.getHours(); ob1.calculateCharges();

ob2.getHours(); ob2.calculateCharges();

ob3.getHours(); ob3.calculateCharges();

//printing ob1.printing(); ob2.printing(); ob3.printing(); {int t; cin >> t; } //for the use of Microsoft Viual studio

return 0;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential Data Protection For Estate Agencies In Singapore 2024

Authors: Yang Yen Thaw Yt

1st Edition

B0CQK79WD3, 979-8872095392

More Books

Students also viewed these Databases questions