Answer to Question #41197 in C++ for Muneeb ul hassan

Question #41197
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;
}

return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS