i am trying to write a c++ program that would accept string values from user at run time. eg, firstname, lastname,matric number etc. the user should terminate input with a letter, say T. the program should display the values when D is input in the format below;
e.g
| S/N | FIRST_NAME | LAST_NAME | MATRIC_ NUMBER |
1 Joel Pius 11n07/022
and the program should terminate when the user enters E.
Cant seem to get around it.Have tried 2D arrays and nested for loops, but still confused. Please any hint or help is appreciated. Thanks
Sorry. I mean the program should display the output in a tabular form. i.e a column for serial number, another column for first name etc. I appreciate your response. Thanks. have to solve this problem tonight
Thanks a lot. But since i would be accepting values based on user input(i.e declaring a variable, say n. the program should accept input n times(i.e firstname, lastname, matric number etc) following this order
Enter firstname for student1
Enter lastname for student1
Enter matric number for student1
that is, complete details for the first student. Then it should continue in this order for n times.
I think using a nested for loop to get user input and and storing the input in a 2D array would be best, but i'm having headache now, because i have spent most of my time in front of my PC without success. Thanks for your time and effort
Thanks a lot of the help, guess i can move on with formatting the output from here. But i still don't get how to read in the values with nested for loops.