//Ok so here's my plan so far please check if i'm on the right track guys! thanks!
#include<iostream.h>
#include<cstring.h>
#include<conio.h>
struct BuyerInfo
{
int id;
string fn;
string mn;
string ln;
string ad;
};BuyerInfo info;
void menu()
{
cout<< "\n================================================================================";
cout<< "\t\t\n WELCOME BUYER!Please fill in the following\n";
cout<< "\n================================================================================";
cout<< "\nBuyer's ID:B";
cin>>info.id;
cout<< "Enter First Name:";
cin>>info.fn;
cout<< "Enter Middle Name:";
cin>>info.mn;
cout<< "Enter Last Name:";
cin>>info.ln;
cout<< "Enter Adress:";
cin>>info.ad;
}
void main()
{
char ans;
int buyid;
cout<< "\n================================================================================";
cout<< "\t\t Welcome to the Black order Grocery system\n";
cout<< "\n================================================================================";
cout<< "\nPlease choose from the following:";
cout<< "\n[A]New user";
cout<< "\n[B]Already a member";
cout<< "\n================================================================================";
cout<< "Answer:";cin>>ans;
clrscr();
if(ans=='A'||ans=='a')
{
menu();
}
else
cout<<"Please Enter BuyerID:";
cin>>buyid;
}
//as you can see my program would ask the user first if he or she is already registered
//if he/she is then the program would ask the user to input his BuyerId and boom! it goes to his records
//although i haven't done it i just want to tell my plan...else if he is not registered, void menu() would
//take place..the question now is..did i do it correctly?Did the member variables on my struct got all
//the inputs?..my last question, my project says, the program should be able to store 100 records..
//i tried putting an array size on my struct..like this but it has an error: struct BuyerInfo[100].
//Can anyone explain this to me?
RonKevin 0 Newbie Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Eagletalon 34 Junior Poster in Training
RonKevin 0 Newbie Poster
Eagletalon commented: teachable and humble, generally pleasant +3
Eagletalon 34 Junior Poster in Training
np complete 8 Newbie Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
RonKevin 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.