Answer to Question #133923 in C++ for ebtehal

Question #133923

A telephone company is charging the customers each month with a service fee as the following:

 1 hour of calls = 45 Riyal

 1 message = 40 Halala

Suppose the company has a customer with 287 minute calls and 23 messages. Write a program that calculates and prints the following:

 The amount charges for calls.

 The amount charges for messages.

 The total amount the customer charges.

[Sample Run] 215.25 9.2 224.45 . . . . . . . . 


1
Expert's answer
2020-09-20T11:57:29-0400
#include <iostream>
using namespace std;

int main() {
    cout << "Enter call minutes: ";
    int minutes;
    cin >> minutes;
    cout << "Enter messages: ";
    int messages;
    cin >> messages;
    double callCharge = 45.0 * minutes / 60;
    double messageCharge = 0.4 * messages;
    cout << callCharge << " " << messageCharge << " " << callCharge + messageCharge << 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
New on Blog
APPROVED BY CLIENTS