All pastes #917920 Raw Edit

Mine

public text v1 · immutable
#917920 ·published 2008-02-25 19:50 UTC
rendered paste body
// Problem 5

#include "stdafx.h" 
#include <iostream>
using namespace std;

int main ()
{
	int Mo, Tu, We, Th, Fr, Sa, Su;
	double minutes;
	char day;
	double time;
	double daytime; 
	double day_time_charge;
	double total_day_time;
	double night_time_charge;
	double total_night_time;
	double total_weekend;
	int daycode;

	
	cout<< "Please enter the first letter of the day that the call is being made \n";
		cin>> day;
	cout<< "Please enter the time that the call is made on the 24 hour scale \n";
		cin>> time;
	cout << "Please enter how long the call was, rounded to the closest minute \n";
		cin>> minutes;
	if (day == 's')
			daycode = 2;
	else 
		daycode = 1;

		
	
	day_time_charge = .40;
		total_day_time = (minutes * day_time_charge);
		night_time_charge = .25;
		total_night_time = (minutes * night_time_charge);
		total_weekend = (minutes * .15);
			if ((time >=8) && (time <=18) && (daycode == 1))
			cout<< "The total cost is "<< total_day_time<<endl;
		
			else if ((time<= 8) && (time >=18) && (daycode ==1))
			cout<< "The total cost is " <<total_night_time<< endl;
			else
				cout<< "The total cost is " <<total_weekend <<endl;



			system("pause");
return 0;	
}