Arkadaşlar çok aci aşağıda tanımlanan C programına ihtiyacım var....Akademik hayatım söz konusu Üzgün
Define two dimensional Demand Matrix which includes number of orders in first column and the cost in the second.
Not: User Takes the Order Names as an array and Retail Cost From the “Demand.txt”
From File USER INPUT
Order Names Retail Cost # of Orders
Order1 = Apple D11 = 1.50 YTL D12 = 2
Order2 = Orange D21 =1.80 YTL D22 = 1
Order3 = Bananas D31 = 3.00 YTL D32 = 2
Order4 = Pear D41 = 2.00 YTL D42 = 3
Step 1) HCI – Take the number of orders from user
Step 2) HCI – Take the discount ratio (indirim)
Step 3) Calculate the Fee, Discounts and Customer Cost for each Orders,
Step 4) HCI – Write below table with respect to given discount ratio to “Customer.txt” file
Order Names # of Orders Fee (%18) Discount ( %10) Customer Cost Total Cost
Order1 = Apple 2 0.270 YTL 0.15 YTL 1.620 YTL 3.240 YTL
Order2 = Orange 1 0,324 YTL 0.18 YTL 1.944 YTL 1.944 YTL
Order3 = Bananas 2 0.540 YTL 0.30 YTL 3.240 YTL 6.480 YTL
Order4 = Pear 3 0,360 YTL 0.20 YTL 2.160 YTL 6.480 YTL
B) Please write a C code above steps using below Struct format.
Struct Order {
char OrderName[10];
int NumberOfOrder;
float RetailCost;
}
Hint : Define a struct array like Struct Order D[10];
Use D[1].OrderName, D[1].NumberOfOrder and D[1].RetailCost
------------------------------------------------------
Demand.txt
Apple 1.50
Orange 1.80
Bananas 3.00
Pear 2.00
Define two dimensional Demand Matrix which includes number of orders in first column and the cost in the second.
Not: User Takes the Order Names as an array and Retail Cost From the “Demand.txt”
From File USER INPUT
Order Names Retail Cost # of Orders
Order1 = Apple D11 = 1.50 YTL D12 = 2
Order2 = Orange D21 =1.80 YTL D22 = 1
Order3 = Bananas D31 = 3.00 YTL D32 = 2
Order4 = Pear D41 = 2.00 YTL D42 = 3
Step 1) HCI – Take the number of orders from user
Step 2) HCI – Take the discount ratio (indirim)
Step 3) Calculate the Fee, Discounts and Customer Cost for each Orders,
Step 4) HCI – Write below table with respect to given discount ratio to “Customer.txt” file
Order Names # of Orders Fee (%18) Discount ( %10) Customer Cost Total Cost
Order1 = Apple 2 0.270 YTL 0.15 YTL 1.620 YTL 3.240 YTL
Order2 = Orange 1 0,324 YTL 0.18 YTL 1.944 YTL 1.944 YTL
Order3 = Bananas 2 0.540 YTL 0.30 YTL 3.240 YTL 6.480 YTL
Order4 = Pear 3 0,360 YTL 0.20 YTL 2.160 YTL 6.480 YTL
B) Please write a C code above steps using below Struct format.
Struct Order {
char OrderName[10];
int NumberOfOrder;
float RetailCost;
}
Hint : Define a struct array like Struct Order D[10];
Use D[1].OrderName, D[1].NumberOfOrder and D[1].RetailCost
------------------------------------------------------
Demand.txt
Apple 1.50
Orange 1.80
Bananas 3.00
Pear 2.00