The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 3 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
The phone company uses the following rate structure for calls from San Francisco to Seattle, Washington:
Any call started at or after 6:00 pm (1800) but before 8:00 am (800) is discounted 50%.
All calls are subject to a 4% federal tax.
The regular rate is $0.35 per minute.
Any call longer than 60 minutes receives a 16% discount on its cost (after any other discount is subtracted but before tax is added).
Write a program that reads from the user the start time for a call based on a 24-hour clock and the length of the call in minutes. The gross cost (before any discount or tax) should be printed, and then the net cost (after discounts and taxes). Turn in 4 outputs for this exercise, showing that your program works in each of the following 4 cases. Use the input examples shown here, don't make up your own.
This is what I have but im probably way off...
#include <iostream>
using namespace std;
int main()
{
int time, minutes, hours;
double Fedtax=.04, Regrate=.35, Greater60=.16, Nightdiscount=.5, gross, net, total;
 Â
cout<<"Enter start time: ";
cin>>hours;
cout<<"Enter length of call in minutes: ";
cin>>minutes;
 Â
hours=time;
gross= minutes*Regrate;
 Â
if (hours<=2400)
{
if (minutes<=60)
{
if (time>=0 && time<800)
{
net=minutes*Regrate*Nightdiscount;
total=net+(net * Fedtax);
}
 Â
else if (time>=800 && time<1800)
{
net=minutes*Regrate;
total=net+(net*Fedtax);
}
 Â
else if (time>=1800 && time<=2400)
{
net=minutes*Regrate*Nightdiscount;
total=net+(net*Fedtax);
}
}
else if (minutes>60)
{
if (time>=0 && time<800)
{
net=minutes*Regrate*Nightdiscount*Greater60;
total=net+(net * Fedtax);
}
 Â
else if (time>=800 && time<1800)
{
net=minutes*Regrate*Greater60;
total=net+(net*Fedtax);
}
 Â
else if (time>=1800 && time<=2400)
{
net=minutes*Regrate*Nightdiscount*Greater60;
total=net+(net*Fedtax);
}
}
cout<<"gross cost: " <<Regrate<< endl;
cout<<"net cost: " <<total<<endl;
}
else if (hours>2400)
cout<<"Invalid hours. ";
return 0;
}
Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- Th-----------ank----------- Yo-----------u f-----------or -----------usi-----------ng -----------our----------- we-----------bsi-----------te -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill-----------