Computer Science, asked by ppyyashhh, 9 months ago

By using Structure statement, write a C Program to calculate the total price for purchasing
book. The input data are Book’s title, Price and quantity

Answers

Answered by VIGYAS
14

Answer:

By using STRUCTURE statement, write a C Program to calculate the total price for purchasing book. The input data are: Book's title, price and quantity. The program must be able to calculate the total price for each book title. If the quantity of books sold is greater than 40, a discount of 10% will be given. Display book's title, price, quantity, total price for each title, discounted amount for each title, and sum of amount payable to the supplier. You should start your program using the segment shown in Figure 2. #include <stdio.h> struct bookType char title[100]; float price; int qh floct tota, Figure 2 Sample output How many order()? Enter book title Book A Enter book pric: RM 56.60 Enter quantity ordered: 35 Enter book title Book B Enter book price: RM 89.50 Enter quantity ordered: 4 Enter book title :Book C Enter book pric: RM 90.00 Enter quantity ordered: 25 Total 981.0 4027.50 2250.00 Discount 0.00 402.75 0.00 After Discount 1981.0 3624.75 2250.00 Book' Title Price aty Book A Book B Book C 56.60 35 89.50 5 90,00 25 Total anount payable: RM 7855.75

Similar questions