63 052
Assignments Done
99,1%
Successfully Done
In July 2018

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
Expert's answer
#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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions