Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include #include int count = 41489; char items[8][100]={Nutella Cruffin,Salted Key Line Pie,Apple Almond Cake,Blueberry Danish,Matcha Latte Coffee, Honey Lemon Juice,Choco Lava Cake,Chocolate Icecream,}; float amt[8]={13.00,12.00,10.00,12.00,10.00,7.00,20.00,12.00,};

#include #include

int count = 41489; char items[8][100]={"Nutella Cruffin","Salted Key Line Pie","Apple Almond Cake","Blueberry Danish","Matcha Latte Coffee", "Honey Lemon Juice","Choco Lava Cake","Chocolate Icecream",}; float amt[8]={13.00,12.00,10.00,12.00,10.00,7.00,20.00,12.00,}; int quantity[8]={0,0,0,0,0,0,0,0,0,0}; float total(int quantity[]) { int i; float total = 0; for(i=0;i<10;i++){ if(quantity[i]!=0) { total += quantity[i]*amt[i]; } } return total; } void display(float total) { printf(" \t\t Ali's Flour Bakehouse "); printf("\t\tA5224, Jalan Sri Jaya, "); printf("\t\t 25200 Kuantan, "); printf("\t\t\tPahang "); time_t t; time(&t); printf(" Dated: %s",ctime(&t)); printf(" Reciept: %d",count++); printf(" Served By: Ali's Flour Bakehouse"); printf(" Table: 01P"); printf(" ----------------------------------------------------- "); printf("Qty\t Item Name\t\t\tAmount"); printf(" ----------------------------------------------------- "); int i; float change; for(i=0;i<10;i++) { if(quantity[i]!=0) { printf(" %d\t%s \t\t%0.2f ",quantity[i],items[i],quantity[i]*amt[i]); } } printf(" ----------------------------------------------------- "); printf("\t\t\t Subtotal: %0.2f ",total); printf("\t\t\t Total: %0.2f ",total); change=total-total; printf("\t\t\t Qrpay: %0.2f ",total); printf("\t\t\t Change: %0.2f ",change); printf(" \t\t Tel:0956541257 "); printf(" \t\t Email:Group11"); printf(" \t\tThank You, Please come again "); } int main() { int i; int ch; int q; printf(" \t*********Menu********* "); for(i=0;i<8;i++) { printf("%d.%s ",(i+1),items[i]); }

{ printf(" \tChoose item: "); scanf("%d",&ch); printf("\tEnter quantity: "); scanf("%d",&q); quantity[ch-1]=q; printf("\tChoose item: "); scanf("%d",&ch); printf("\tEnter quantity: "); scanf("%d",&q); quantity[ch-1]=q; printf("\tChoose item: "); scanf("%d",&ch); printf("\tEnter quantity: "); scanf("%d",&q); quantity[ch-1]=q; printf("\tChoose item: "); scanf("%d",&ch); printf("\tEnter quantity: "); scanf("%d",&q); quantity[ch-1]=q; printf("\tChoose item: "); scanf("%d",&ch); printf("\tEnter quantity: "); scanf("%d",&q); quantity[ch-1]=q; printf("\tChoose item: "); scanf("%d",&ch); printf("\tEnter quantity: "); scanf("%d",&q); quantity[ch-1]=q;

} float t = 0; t = total(quantity); display(t); return 0; }

EXPLAINATION AND DISCUSSION ABOUT THE PROGRAM CODE?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

=+j Explain the relationship between unions and MNEs.

Answered: 1 week ago