Task 2) Write and execute a C program using onlinegdp.com which is an online C compiler with descriptive comments explaining each line of code, paste the code as text and output obtained as result of...


Task 2)<br>Write and execute a C program using onlinegdp.com which is an online C compiler with<br>descriptive comments explaining each line of code, paste the code as text and output obtained as result<br>of execution in the report:<br>a) Input price and quantity of five items. [10 marks for explaining the code]<br>b) Save the prices and quantities of each item into arrays. [5 marks for explaining the code]<br>c) Write a function to calculate and display the subtotal for each item (Subtotal = price * quantity).<br>d) Display your output as a screenshot<br>Sample Output:<br>Enter price and quantity: 200 1<br>Enter price and quantity: 400 1<br>Enter price and quantity: 200 3<br>Enter price and quantity: 10 5<br>Enter price and quantity: 50 2<br>Quantity<br>Item<br>Price<br>Subtotal<br>Item 1<br>Item 2<br>Item 3<br>Item 4<br>Item 5<br>200<br>1<br>200<br>400<br>400<br>200<br>3<br>600<br>10<br>5<br>50<br>50<br>2<br>100<br>

Extracted text: Task 2) Write and execute a C program using onlinegdp.com which is an online C compiler with descriptive comments explaining each line of code, paste the code as text and output obtained as result of execution in the report: a) Input price and quantity of five items. [10 marks for explaining the code] b) Save the prices and quantities of each item into arrays. [5 marks for explaining the code] c) Write a function to calculate and display the subtotal for each item (Subtotal = price * quantity). d) Display your output as a screenshot Sample Output: Enter price and quantity: 200 1 Enter price and quantity: 400 1 Enter price and quantity: 200 3 Enter price and quantity: 10 5 Enter price and quantity: 50 2 Quantity Item Price Subtotal Item 1 Item 2 Item 3 Item 4 Item 5 200 1 200 400 400 200 3 600 10 5 50 50 2 100

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here