-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
34 lines (29 loc) · 1.01 KB
/
main.cpp
File metadata and controls
34 lines (29 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include<iostream>
using namespace std;
#include "./models/Rider.h"
#include "./Zuber.h"
#include "./strategies/PaymentStrategy.h"
#include "./strategies/upiPaymentStrategy.h"
#include "./strategies/creditCardPaymentStrategy.h"
#include "./strategies/BookRideStrategy.h"
#include "./strategies/BookRideByVehicleStrategy.h"
int main(){
//Initialize the Drivers and our App Zuber
Zuber* zuber = new Zuber();
//Creating a Rider
//Taken 'a' to 'z' as the locations for easy calculations
//if change the sedan to bike other rider will be assigned
Rider* rider1 = new Rider("Rahul","9538465132",'a','f',"sedan");
//Rider books the Ride and Driver Accept it according to the VehicleType
zuber->bookRide(rider1);
zuber->finishRide();
//Calculate the Fare for a Rider
zuber->FareCalculation(rider1);
//User Pays the money using Upi
PaymentStrategy* ps = new UpiPaymentStrategy("9875632145");
zuber->PayFare(ps);
delete rider1;
delete zuber;
delete ps;
return 0;
}