Q1)Further enhance your program below as follows (include a loop structure): • allow data to be continuously input for more customers • After processing the last customer’s order, display a summary report of sales of the day showing details of total number of customers, a summary of each of the packages sold for the day and the total sales value

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question
100%

Q1)Further enhance your program below as follows (include a loop structure):

• allow data to be continuously input for more customers

• After processing the last customer’s order, display a summary report of sales of the day showing details of total number of customers, a summary of each of the packages sold for the day and the total sales value 

#include <stdio.h> #include <stdlib.h> #include<string.h> #pragma warning(disable:4996) int main(void) { // Variable declarations int t = 0; float k, y, u, i; int a, b, c, d; int p; float add, tt, f; char name[30], ic[20]; char addr[50]; //The personal details of customer // printf("\n========================================================================================================\n"); printf("\n Vegetable ordering system\n"); printf("\n========================================================================================================\n"); printf("Please enter your full name :"); scanf(" %[^\n]", &name); printf("Please enter your ic number :"); scanf("%s", &ic); printf("Please enter your phone number :"); scanf("%d", &p); printf("Please enter your home address :"); scanf(" %[^\n]", &addr); printf("\n========================================================================================================\n"); printf("The customer name is %s and the ic number is %s \n", name, ic); printf("The customer who is come from %s", addr); printf("\n========================================================================================================\n"); //Order part of program// printf("\n========================================================================================================\n"); printf(" Enter the order quetity purchase \n"); printf("\n========================================================================================================\n"); printf("Please order the package A :"); scanf("%d", &a); printf("Please order the package B :"); scanf("%d", &b); printf("Please order the package C :"); scanf("%d", &c); printf("Please order the package D :"); scanf("%d", &d); printf("\n========================================================================================================\n"); if (a, b, c, d > t) { printf("%d", a - t); k = (24.5) * a; printf("\nPackages A (RM 24.5) :RM%.2f\n", k); y = (26.5) * b; printf("\nPackages B (RM 26.5) :RM%.2f\n", y); u = (26.5) * c; printf("\nPackages C (RM 26.5) :RM%.2f\n", u); i = (24.5) * d; printf("\nPackages D (RM 24.5) :RM%.2f\n\n", i); //The addition part for total cost for customer to pay// add = k + y + u + i; tt = add + 5.90; f = tt - (0.15 * tt); if (add > 100) { printf("Total =RM%.2f\n", add); printf("The delivery fee which is fixed =RM5.90\n "); printf("\n======================================================================================================\n"); printf("The total price for customer need to pay with 15 percent discount =RM%.2f\n", f); printf("\n======================================================================================================\n"); } else if(add>80) { printf("Total =RM%.2f\n", add); printf("\n======================================================================================================\n"); printf("The total price for customer need to pay and the delivery charge is waived =RM%.2f\n", add); printf("\n======================================================================================================\n"); } else { printf("Total =RM%.2f\n", add); printf("The delivery fee which is fixed =RM5.90\n "); printf("\n======================================================================================================\n"); printf("The total price for customer need to pay and the delivery fee =RM%.2f\n", tt); printf("\n======================================================================================================\n"); } system("pause"); return 0; } }
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education