//OrinTill Qimid CS1A Chapter 4, P. 221, 10
//
/**************************************************************
* calculate call charges
*
* ____________________________________________________________
* This program will claculate how much it would cost for long distance call.
* ____________________________________________________________
* INPUT
* when : the time of the call.
* time : how long the call was.
* OUTPUT
* cost : the total cost of the phone call.
**************************************************************/
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
float when,
time,
cost;
cout<<"At what time was your phone call?(please enter in HH.MM ex 7:00 is 7.00)"<<endl;
cin>> when;
if (when<0)
{
cout<<"sorry that's not a valid time"<< endl;
}
cout<<"How long as your phone call?"<< endl;
cin>>time;
if (when<=6.59)
{
cost = time * 0.12;
cout<<"your cost would be $"<<cost<<endl;
}
else if (when<=19.00)
{
cost=time * 0.55;
cout<<"your cost would be $"<<cost<<endl;
}
else if (when<=23.59)
{
cost=time * 0.35;
cout<<"your cost would be $"<<cost<<endl;
}
return 0;
}
Ly9PcmluVGlsbCBRaW1pZCBDUzFBIENoYXB0ZXIgNCwgUC4gMjIxLCAxMAovLwovKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICogY2FsY3VsYXRlIGNhbGwgY2hhcmdlcwogKiAKICogX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCiAqIFRoaXMgcHJvZ3JhbSB3aWxsIGNsYWN1bGF0ZSBob3cgbXVjaCBpdCB3b3VsZCBjb3N0IGZvciBsb25nIGRpc3RhbmNlIGNhbGwuCiAqIF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwogKiBJTlBVVAogKiB3aGVuIDogdGhlIHRpbWUgb2YgdGhlIGNhbGwuCiAqIHRpbWUgOiBob3cgbG9uZyB0aGUgY2FsbCB3YXMuCiAqIE9VVFBVVAogKiBjb3N0IDogdGhlIHRvdGFsIGNvc3Qgb2YgdGhlIHBob25lIGNhbGwuCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KI2luY2x1ZGUgPGNtYXRoPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSAKewogICAgZmxvYXQgd2hlbiwKICAgIHRpbWUsCiAgICBjb3N0OwogICAgY291dDw8IkF0IHdoYXQgdGltZSB3YXMgeW91ciBwaG9uZSBjYWxsPyhwbGVhc2UgZW50ZXIgaW4gSEguTU0gZXggNzowMCBpcyA3LjAwKSI8PGVuZGw7CiAgICBjaW4+PiB3aGVuOwogICAgaWYgKHdoZW48MCkKICAgIHsKICAgICAgICBjb3V0PDwic29ycnkgdGhhdCdzIG5vdCBhIHZhbGlkIHRpbWUiPDwgZW5kbDsKICAgIH0gIAogICAgY291dDw8IkhvdyBsb25nIGFzIHlvdXIgcGhvbmUgY2FsbD8iPDwgZW5kbDsKICAgIGNpbj4+dGltZTsKICAgIGlmICh3aGVuPD02LjU5KQogICAgewogICAgICAgIGNvc3QgPSB0aW1lICogMC4xMjsKICAgICAgICBjb3V0PDwieW91ciBjb3N0IHdvdWxkIGJlICQiPDxjb3N0PDxlbmRsOwogICAgfQogICAgZWxzZSBpZiAod2hlbjw9MTkuMDApCiAgICB7CiAgICAgICAgY29zdD10aW1lICogMC41NTsKICAgICAgICBjb3V0PDwieW91ciBjb3N0IHdvdWxkIGJlICQiPDxjb3N0PDxlbmRsOwogICAgfQogICAgZWxzZSBpZiAod2hlbjw9MjMuNTkpCiAgICB7CiAgICAgICBjb3N0PXRpbWUgKiAwLjM1OwogICAgICAgY291dDw8InlvdXIgY29zdCB3b3VsZCBiZSAkIjw8Y29zdDw8ZW5kbDsKICAgIH0KICAgIAogICAgCiAgCiAgICAKICAgIAogCglyZXR1cm4gMDsKfQ==