Question
Hi! I writing book shop managment code for my school project in c++ I need help to writing int sale_book() function in **C++** This function
Hi! I writing book shop managment code for my school project in c++
I need help to writing int sale_book() function in **C++**
This function should open "Book_adventure.txt" and get the information of the books(sale price,stock info) as seen in the output
After get stock and sale info it should get the sales amount from user and return money(int) where it is called
After sale it should change stock information in "Book_adventure.txt" If stock is over, delete the whole line which containing information about the book
In "Book_adventure.txt" each line has information about 1 book
as example:
1.Line: Bookname:book1*Authorname:autorhor1*Genre:adventure*Purchaseprice:9+Saleprice:10&Stockinformation:50! (I use speacial signs while writing to file to distinguish strings)
*Book_adventure - Not Defteri Dosya Dzen Biim Grnm Yardm book1*author1*adventure*9+10&50! book2*author2*adventure 15+17810! St 1, Stn 33 100% Windows (CRLF) UTF-8 EMPLOYEE PAGE- 1. Show Books 2.Sell Books 3. Exit 2 Enter the book name : book1 Enter the book genre : adventure Bookname : Booki sale price : 10 Stock: 50 Enter the number of sales: 5 Books successfully sold! r *Book_adventure - Not Defteri Dosya Dzen Biim Grnm Yardm book1*author1*adventure*9+10&45! book2*author2*adventure*15+17&10! St 1, Stn 33 100% Windows (CRLF) UTF-8Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started