//*************************************************************************************
// This program keeps track of speakers' bureau.
// It displays a menu, where the user can add info,
// view the info of another speaker that's already in there,
// and etc.
//*************************************************************************************
#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace std;
//**************************************************************************************
// this is the Speaker structure combines the info/data about a speaker
//**************************************************************************************
struct Speaker{
const int SIZE = 50;
char name [SIZE] = "_";
char telNumber[SIZE] = "_";
char topic [SIZE]= "_";
double fee = 0;
};
//**************************************************************************************
// this function displays the menu to the user
//**************************************************************************************
void displayMenu(){
cout << "\n\tWelcome to Speaker's Bureau Menu\n\n";
cout << "1. Add a speaker\n";
cout << "2. View speaker's info\n";
cout << "3. Display the number of speakers that are on the list\n";
cout << "4. Quit the program\n\n";
}
//**************************************************************************************
// this function inputs, validates and returns the user's menu choices
//**************************************************************************************
int getChoice(){
int choice;
cin >> choice;
while (choice < 1 || choice > 4){
cout << "Please, enter the valid choice input, 1-4.";
cin >> choice;
};
return choice;
}
//**************************************************************************************
// this function lets the user add info of a speaker
//**************************************************************************************
//void addSpeaker(){
// return;
//}
//**************************************************************************************
// main function
//**************************************************************************************
int main(){
int choice;
do{
displayMenu();
choice = getChoice();
if(choice == 1){
};
}while (choice != 0);
return 0;
}
First of all, my program isn't complete yet, cause, I'm stuck. So, sorry if it looks messy or crappy.
Lemme, give you an idea of what my program should do:
It displays a menu of 4 choices - User chooses one - and each choice calls for a function - and so forth.
Here is my question:
1) As you see up top, inside the "struct Speaker", i've got 4 variables. They are all supposed to be in C-STRING. And C-STRING is like an array. The question is: after I declare the size of those variables, let's say I put 10 to the "NAME" variable...what if someone's name is longer/shorter than that? Is there a way of making it default or something?
2) The program overall is supposed to take input from the user, do some displaying and so forth. I have to store those data inputs into an ARRAY OF STRUCTUREs. How can I do that? I am having a hard time wrapping my head around it.
Please, someone HELP!!!
Thanks in advance!