Help a random student

I need help in creating a programme I just need guidance as im pretty bad at C++ This programme is about creating a membership management system which offers 10-20% discount for all products to members, membership is free and card is given which display name expiry date. members given 10% discount and if spending accumulated exceeded 500 membership will be upgraded to gold and 20% discount is given.

Main features of the application, membership data will be stored in a text file, has a login screen for staff, after logging in a menu of task for the staff is given which are -

a)Display all the membership information,b)Search membership by personal code or member card number,c)Add a new membership,d)Delete membership by personal code,e)Update phone number for member,f)Update accumulated spending amount,g)Upgrading membership from classic to gold,h)Display summary:number of members, number of classic members and number of gold members.

The data items to be read from text file-Members.txt
Member name Alex
Member card number T123
Personal code F1234567E
DOB 11/01/1991
Mobile number 12345678
Email address 123@gmail.com
Total amount spent 154.39
Type classic(or gold)

The data items to be saved to the text file-summary.txt
inside the text file - Number of Members,Number of classic members,number of gold members

Others
a)Computation:
total amount spent = total amount spent + amount spent
count number of members,number of classic members,number of gold members
b)Decision making
if total amount spent >=500 , update membership type= gold
if personal code=xxxx entered by user,display the member's particulars.
> I need help in creating a programme
Everything begins with:
1
2
3
int main ( ) {
    return 0;
}


> I just need guidance as im pretty bad at C++
A situation that will not improve by continuing to get other people to do the work.

No one is asking for the "perfect" C++ program (such a thing doesn't exist). If it's going some way to solving your requirements, it will be fine.

I mean, if you can manage just cout and cin, you can do quite a lot of this assignment already.

Then perhaps we can see what your real question is.

Whereas at the moment, it looks like you're expecting us to do all the work.
Start simple. Define a class for a member. Create methods to read a member from a file and write a member to a file.

Get this code working. Create (by hand) a file with one member. Write a main program to read the member from this file and write them to another file.

Next, add a second member to the file. Modify the program to read all members from the input file and write them to the output file.

Now add the menu logic. Start with one option: display all members. Then add the option to display one member's info. This will mean reading the input file and displaying only the information for the user who matches the personal code or member number.

The code to modify a user is harder than you might expect. You have to read the input file and write all the members to a temporary output file, with the twist that when you find the right member, you have to change the phone number before writing it out. Once you write all the users to the temp file, rename that file to be the original input file.

The key here is that you want to do this assignment a little bit at a time. Write code to do something, compile test and get it working. Then add the next thing, compile and test, etc.
Topic archived. No new replies allowed.