please dix the code: #include #include using namespace std; struct Row // structure to store data of
Question:
please dix the code:
#include
struct Row // structure to store data of a row { string code; string name; float unit; float cost; float price; float total_profit; float total_sales; }row;
Note:
Case Study
Ava Silva owns Mythos Books, a small bookstore that buys and sells used books, with a focus on rare and out-of-print historical, fantasy, and science fiction books.
Ava operates a store-front in Toronto's East End and employs a small staff to help run her store, send out orders, and handle customer service. She doesn't really have an online presence right now; online customers can only communicate by email to ask about books, and she accepts e-transfers or PayPal before sending the requested books to those customers. There is no system to track these orders or payments, though.
She would like to purchase software to help her manage her store and also enable her to easily take online orders, as emailing is messy and complicated. Your team has been hired to document Ava's requirements and recommend software for Ava to purchase.
When a customer comes in to sell a book to Mythos Books, Ava will review the book to determine the it's condition and set a price based on that. For example, a first edition, excellent condition copy of "The Hobbit" could be worth thousands of dollars, while a newer edition that's a bit more worn will be worth only a few dollars. Ava will buy the book for one price, and list it for sale for a higher price. This means that the book "The Hobbit" will have multiple copies, of different values.
Your team has started looking at Ava's financial records and found that Ava allows for different payment methods and would like to categorize her income and expense transactions accordingly.
int main() { // to categorise according to the data being read from data.txt // we have stored names of products and their costs string codes[]={"M101","B202","C303","F404"}; string products[]={"Double Mushroom","Double BBQ Beef","Grilled Chicken","Fish and Crisp"}; float costs[]={11.50,10.00,12.50,15,00}; int row_count=0; ifstream f("data.txt"); ofstream fi("DailySalesAnalysis.txt"); fi<<"Daily Sales Report "; fi<<"----------------------------------------------------------------------------------------------- "; fi<<"NO\tCODE\tPRODUCT\t\tUNIT\tCOST\t\tPRICE\t\tT.PROFIT\tT.SALES"; fi<<" ----------------------------------------------------------------------------------------------- "; // while data.txt has lines while(!f.eof()) { f>>row.code; f>>row.unit; ++row_count; if(row.code==codes[0]) { row.name=products[0]; row.cost = costs[0]; row.price = row.cost*1.30f; row.total_profit = (row.price-row.cost)*row.unit; row.total_sales = row.price*row.unit; } else if(row.code==codes[1]) { row.name=products[1]; row.cost = costs[1]; row.price = row.cost*1.3f; row.total_profit = (row.price-row.cost)*row.unit; row.total_sales = row.price*row.unit; } else if(row.code==codes[2]) { row.name=products[2]; row.cost = costs[2]; row.price = row.cost*1.30f; row.total_profit = (row.price-row.cost)*row.unit; row.total_sales = row.price*row.unit; } else { row.name=products[3]; row.cost = costs[3]; row.price = row.cost*1.30f; row.total_profit = (row.price-row.cost)*row.unit; row.total_sales = row.price*row.unit; } // lingle line into 'DailySalesAnalysis.txt' fi< return 0; }
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill