Current location - Training Enrollment Network - Books and materials - How to pack the books at home?
How to pack the books at home?
C++ programming, I really miss it.

First, please try to use the database. Of course, I understand that you use words, and I only used words when I was a student. Well, I want to say that it is a very troublesome thing to store information and extract information with words.

You need to make your own storage format, which means you need to write at least two fixed tool classes, reading and writing (storing data in the set format). Then you need to process the data read from the text, that is, encapsulate it into classes. Since it is object-oriented in C++, you should be familiar with it. You know the entity class.

To put it bluntly, your business is to add, delete and check. I'm too lazy to say this. To put it simply, modification is to change the attributes of the data class you package and put the tool class in the database (your txt text); Delete is to delete data from the text, I don't know how to explain it in detail; Add is to write a piece of data with a tool class; The query is reading text using the tool class.

The above needs IO stream implementation. I think this meeting will.

Anyway, the interface is the console, so write it in printf yourself. If you want to write beautifully, do more. It's just an interface.

Probably give you a structure.

First of all, I want to say that you probably can't get rid of process-oriented thinking; But my structure is suitable for completely object-oriented, so you can see for yourself.

Subject: the bottom tool of user interface business (add, delete, modify and query).

Interface: Home Level 1 Menu Branch Menu (filled in according to my template)

Business: "(3) Functions to be realized" Write this thing here.

Bottom layer: database (txt text) data encapsulation (entity class) tool class (reading data, data encapsulation)

I've been detailed enough. To tell the truth, such a simple thing can't tell you so much. Build it yourself.

By the way, I wrote it for you according to MVC, which is enough to give you modules.

The difficulty of your program lies in the design of database format (txt). It is not difficult to design a readable fixed storage format. The most handwritten place is probably the interface.

That's all. If you are really interested in development (maybe just to cope with the course), you can chat with Baidu Hi.

Ask me for QQ number, I know very little time on Baidu.