Need help with my project

my project is to create an admissions system with a menu that is:

1. Add an applicant.
2. View all applicants.
3. Count all applicants.
4. Count number of applicants who are underage (age less than 4).
5. List accepted applicants.
6. Remove applicant.
7. Exit.

my question in for the first one:

we have to use arrays.

If the user chooses 1, the program should perform the following tasks:
a. Allow the user to enter first name, last name, and age.
b. Ask for the result of the interview.
c. Add the information (first name, last name, age, interview result, to the txt file that manages the admission applications.

I'm stuck, i can't think of a way to solve this.

if you can, please help.

thank you
Last edited on
Have you learned about arrays in your class? If so, try to envision how the required data could be placed into arrays.
yes, I have worked with arrays before, but they were always initialized.

like for example:

const int n=3;

string StudentName[n]={"Hanna","Terry","Phil"}; <---- like this

but i need to know how i can get that information from the user and save it in an array

a 2 dimensional array, to be exact. (I've worked with them too, but they were also initialized)

after getting the input from the user and saving it to an array i have to display it.

like this
First name Last name age interview result

Hanna ----- Jones ----- 9 ---- pass

Terry ----- Miller ---- 8 ----- fail

Phil ------- Moore --- 10 ----- pass

I tried all day to figure out how to do this...


Last edited on
Have you worked with structs?

If you have, it is a simple matter to create a struct to represent one student.
1
2
3
4
5
6
struct Student
{  string first_name;
   string last_name;
   int age; 
   bool pass;
};


Once you have that, then you can create an array of students.
 
  Student students[20];  // Or what ever your maximum number of students is. 


You don't want to use a two dimensional array for this assignment.



@AbstractionAnon

we haven't taken structs in class, but I just read more about it and it seems to work with my project.

I'm working with it right now.

Thanks for your help!
Topic archived. No new replies allowed.