-
Notifications
You must be signed in to change notification settings - Fork 1
/
Exer3.cpp
86 lines (67 loc) · 1.54 KB
/
Exer3.cpp
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include<iostream>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int hrs;
float pack1;
float pack2;
void hours1()
{
cout<<"How many hours did you use it?"<<endl;
cin>>hrs;
cout<<endl;
if(hrs <=200)
{
cout<<"----->Your Monthly Bill is P400.00"<<endl;
}
else
{
cout<<"----->Your Monthly Bill is "<<400+((hrs-200)*30)<<endl;
}
system("pause");
}
void hours2()
{
cout<<"How many hours did you use it?"<<endl;
cin>>hrs;
cout<<endl;
if(hrs <=400)
{
cout<<"----->Your Monthly Bill is P700.00"<<endl;
}
else
{
cout<<"----->Your Monthly Bill is "<<700+((hrs-400)*20)<<endl;
}
system("pause");
}
// Main function
int main()
{
int packageNum;
cout<<"\t\t\t Welcome to Malayan Internet Service Provider(MISP) "<<endl;
cout<<endl;
cout<<"Package 1:200 hours of access are provided for P400.00. Exceeding hours costs P30.00 per hour."<<endl;
cout<<"Package 2:400 hours of access are provided for P700.00. Exceeding hours costs P20.00 per hour."<<endl;
cout<<"Package 3:Unlimited acess is provided for P999.00."<<endl;
cout<<"\n\n ******What package do you want to avail? ";
cin>>packageNum;
if(packageNum==1)
{
cout<<"Package 1\n\n";
hours1();
}
else if(packageNum==2)
{
cout<<"Package 2\n\n";
hours2();
}
else if(packageNum=3)
{
cout<<"Package 3\n\n";
cout<<"The total amout you have to pay is P999.00. "<<endl;
system("pause");
}
getch();
}