Computer Science, asked by MuhammadMuzammmal, 8 months ago

Suppose that the cost of sending an international fax is calculated as follows:

Service charges Rs. 15.00; Rs 13.0 per page for the first 10 pages; and Rs. 9.0 for each additional

page Asks the user to enter the number of pages to be faxed and calculate the amount due. c++ program​

Answers

Answered by giriaishik123
2

Calculate the sellingPrice using the formula: sellingPrice = (originalPrice + originalPrice*0.80) * 0.90The information needed to calculate the selling price is the original price and the marked-up percentage.

17. Suppose that the cost of sending an international fax is calculated as follows: Service charges $3.00, $0.20 per page for the first 10 pages, and $0.10 for each additional page. Design an algorithm that asks the user to enter the number of pages to be faxed. The algorithm then uses the number of pages to be faxed to calculate the amount due.Suppose that numOfPages denotes the number of pages to be faxed and billingAmount denotes the total charges for the pages faxed. To calculate the total charges, you need to know the number of pages faxed.If numberOfPages is less than or equal to 10, the billing amount is service charges plus (numOfPages*0.20); otherwise, billing amount is service charges plus 10*0.20 plus(numOfPages-10)*0.10. You can now write the algorithm as follows:a.Get numOfPages.b.Calculate billing amount using the formula: if (numOfPages is less than or equal to 10) billingAmount = 3.00 + (numOfPages * 0.20); otherwise billingAmount=3.00 +10*0.20 +(numOfpages – 10)*0.10;

Answered by MotiSani
0

C++ program to execute the given task is as follows:-

#include <iostream>

int main() {

   // Write C++ code here

   int n;

   std::cout << "Enter the number of pages to be faxed: ";

   std::cin >> n;

   

   int amount;

   if(n <= 10) {

       amount = 15 + (n *13);

   }

   else {

       amount = 15 + 10*13 + (n -10)*9;

   }

   std::cout << amount;

   return 0;

}

  • Firstly, we have declared a variable n using the statement:

        int n;

        where n indicates the number of pages.

  • Next, we have taken the input in the variable 'n' from the user.
  • Further, we have calculated the cost of sending an international fax using if-else and stored it in a variable amount.
  • Finally, we have printed the cost using the statement:

        std::cout << amount;

  • Hence, the given task is executed.

                                                                                                                #SPJ3

Similar questions