Question

In: Computer Science

Sonia uses noon website to buy various items. if the total cost of the ordered items,...

Sonia uses noon website to buy various items. if the total cost of the ordered items, at one time is 1000 AED or more then the shipping is free: otherwise the shipping will cost 10 AED/ item. write a C++ program that prompts Sonia to enter the number of items ordered and the price of each one of them. the program will then output the total billing amount, your program must use a for loop.

Solutions

Expert Solution

// C++ program to compute the total billing amount for the ordered items
#include <iostream>

using namespace std;

int main()
{
// initialize total cost to 0
double total_cost = 0, cost;
int num_items;

// input the number of items ordered
cout<<"Sonia, enter the number of items ordered: ";
cin>>num_items;

// for loop to input cost for each item, adding it to total cost
for(int i=0;i<num_items;i++)
{
cout<<"Enter the cost of item-"<<(i+1)<<": ";
cin>>cost;
total_cost += cost;
}

// if number of items > 0 and total cost < 1000, add shipping cost of 10AED/item
if(num_items > 0 && total_cost < 1000)
total_cost += (10*num_items);

// display the total billing amount
cout<<"Total billing amount: "<<total_cost<<" AED"<<endl;

return 0;
}

//end of program

Output:


Related Solutions

1b There are various items that reduce taxable income relative to total income – what is...
1b There are various items that reduce taxable income relative to total income – what is the general term for these items (collectively, do not list all of them individually)? What do you think is the economic justification for these not being included in taxable income? Pick one and explain its specific justification. 1c: Under ‘taxable income assessed’ there are various items, usually called ‘amounts’. What is the general term for these items? Pick one, and explain briefly what you...
Total Cost Concept of Product Costing Willis Products Inc. uses the total cost concept of applying...
Total Cost Concept of Product Costing Willis Products Inc. uses the total cost concept of applying the cost-plus approach to product pricing. The costs of producing and selling 5,000 units of medical tablets are as follows: Variable costs per unit: Fixed costs: Direct materials $120 Factory overhead $205,000 Direct labor 44 Selling and admin. exp. 70,000 Factory overhead 37 Selling and admin. exp. 29 Total $230 Willis Products desires a profit equal to a 20% rate of return on invested...
Ayayai Co. both purchases and constructs various equipment it uses in its operations. The following items...
Ayayai Co. both purchases and constructs various equipment it uses in its operations. The following items for two different types of equipment were recorded in random order during the calendar year 2020. Purchase Cash paid for equipment, including sales tax of $6,700 $140,700 Freight and insurance cost while in transit 2,680 Cost of moving equipment into place at factory 4,154 Wage cost for technicians to test equipment 5,360 Insurance premium paid during first year of operation on this equipment 2,010...
Blossom Co. both purchases and constructs various equipment it uses in its operations. The following items...
Blossom Co. both purchases and constructs various equipment it uses in its operations. The following items for two different types of equipment were recorded in random order during the calendar year 2020. Purchase Cash paid for equipment, including sales tax of $5,700 $119,700 Freight and insurance cost while in transit 2,280 Cost of moving equipment into place at factory 3,534 Wage cost for technicians to test equipment 4,560 Insurance premium paid during first year of operation on this equipment 1,710...
In the space provided below write a C program that computes the total cost of items...
In the space provided below write a C program that computes the total cost of items you want to order online. It does so by first asking how many items are in your shopping cart and then based on that number, it repeatedly asks you to enter the cost of each item. It then adds a 5% delivery charge for standard delivery if the total is below $1,000, and an additional 10% charge if you want an expedited next day...
In the space provided below write a C program that computes the total cost of items...
In the space provided below write a C program that computes the total cost of items you want to order online. It does so by first asking how many items are in your shopping cart and then based on that number, it repeatedly asks you to enter the cost of each item. It then adds a 5% delivery charge for standard delivery if the total is below $1,000, and an additional 10% charge if you want an expedited next day...
In this make or buy problem, you should compute the total cost of making a particular...
In this make or buy problem, you should compute the total cost of making a particular part and the total costs of buying the same part. Try following the solutions steps: Determine the parameters of the make cost function - the variable costs per unit and the fixed costs. Determine the fixed costs that are avoidable and the fixed costs that are unavoidable. Determine the buy price. Determine the alternative use of the idle resources under the buy, Note that...
In this make or buy problem, you should compute the total cost of making a particular...
In this make or buy problem, you should compute the total cost of making a particular part and the total costs of buying the same part. Try following the solutions steps: Determine the parameters of the make cost function - the variable costs per unit and the fixed costs. Determine the fixed costs that are avoidable and the fixed costs that are unavoidable. Determine the buy price. Determine the alternative use of the idle resources under the buy, Note that...
Nova Company’s total overhead cost at various levels of activity are presented below: Month Machine-Hours Total...
Nova Company’s total overhead cost at various levels of activity are presented below: Month Machine-Hours Total Overhead Cost      April 50,000           $184,400              May 40,000           $160,000              June 60,000           $208,800              July 70,000           $233,200         Assume that the total overhead cost above consists of utilities, supervisory salaries, and maintenance. The breakdown of these costs at the 40,000 machine-hour level of activity is:   Utilities (variable) $ 52,000     Supervisory salaries (fixed) 45,000   Maintenance (mixed) 63,000   Total overhead cost $...
Nova Company’s total overhead cost at various levels of activity are presented below: Month Machine-Hours Total...
Nova Company’s total overhead cost at various levels of activity are presented below: Month Machine-Hours Total Overhead Cost      April 48,000           $196,100              May 38,000           $170,600              June 58,000           $221,600              July 68,000           $247,100         Assume that the total overhead cost above consists of utilities, supervisory salaries, and maintenance. The breakdown of these costs at the 38,000 machine-hour level of activity is:   Utilities (variable) $ 57,000     Supervisory salaries (fixed) 54,000   Maintenance (mixed) 59,600   Total overhead cost $...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT