Need help with my programming project

Hello, I need help with my programming project here. My project was simple time converter which i manually plus the time.However I am having trouble for some country time for example Myanmar, which is GMT +6.30.Because when I i input the time time(1500 for example)- 130 it will become 1500-130 which is 1370(it should be 1330) how can I solve this problem? and how do I make the time display the 1st zero if the time was 0155?

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
  #include <iostream>

using namespace std;

float time,x,a,b,c,d,e,f,g,h;

int main()
{
cout<<"Welcome to Malaysia Time Zone Converter";
cout<<"\nEnter the time: ";
cin>>time;
cout<<"\n1.China\n2.Korea\n3.Thailand\n4.Japan\n5.Myanmar";
cout<<"\nPlease pick the country you prefer in the list above: ";
cin>>x;

a = time;//China
b = time + 100;//Korea
c = time - 100;//Thailand
d = time + 100;//Japan
e = time - 130;//Myanmar

if (x==1)
{
cout<<"The time in China is: "<<a<<endl;
}

if (x==2)
{
cout<<"The time in Korea is: "<<b<<endl;
}

if (x==3)
{
cout<<"The time in Thailand is: "<<c<<endl;
}

if(x==4)
{
cout<<"The time in Japan is: "<<d<<endl;
}

if(x==5)
{
cout<<"The time in Myanmar is: "<<e<<endl;
}

}
Last edited on
Topic archived. No new replies allowed.