Hello, I need help with my programming project here. My project was simple time converter which i manually plus the time(convert from GMT+8 to other 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, so for myammar it will be 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? and how do i limit to 0000 and 2359(like example 0100 - 130 will become -30 but not display 2330.
#include <iostream>
usingnamespace 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;
}
}