Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)image text in transcribed

image text in transcribed

image text in transcribed

*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-8

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

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

Identify and control your anxieties

Answered: 1 week ago

Question

Understanding and Addressing Anxiety

Answered: 1 week ago