Write a program that computes the cost of a long distance call. The cost of the call is determined according to the following rate schedules.
• A call made between 8:00 AM and 6:00 PM is billed at a rate of 6 rupees per minute.
• A call made before 8:00 AM or after 6:00 PM is charged at a rate of 3.75 rupees
1
Expert's answer
2014-04-11T10:25:07-0400
#include <iostream>
int main() { int callTime, minutes;
std::cout << "Please input 1 if is between 8:00 AM and 6:00 PM now, or 0 otherwise" << std::endl; std::cin >> callTime; std::cout << "Please input number of minues you want to talk" << std::endl; std::cin >> minutes; if (callTime) { std::cout << "You call is worth " << (double)minutes * 6 << " rupees" << std::endl; } else { std::cout << "You call is worth " << (double)minutes * 3.75 << " rupees" << std::endl; }
Comments
Leave a comment