My program works but I need help making a menu

So I made a program list that shows data from a person, the day they go to class and the name of their team. and open the result in a PDF
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <cstdlib>
#include <stdlib.h>
#include <windows.h>
using namespace std;
int muestra(char* asigno1, char* asigno2){
    printf("%s\n",asigno1);
    system(asigno2);
    system("pause");
}
int main(){
	int i=1;
	char* signo[10][3] = {
                          {"DANIEL","saturday.pdf","Peches"},
                          {"MICHELLE","saturday.pdf","Peches"},
                          {"TELLO","saturday.pdf", "Jokers"},
                          {"MARTIN","sunday.pdf","Jokers"},
                          {"RUBEN","sunday.pdf","Kipies"},
                          {"JOSE","sunday.pdf","Kipies"},
                          {"JORGE","saturday.pdf","Kipies"},
                          {"RIGOBERTO","saturday.pdf","Chastra"},
                          {"MARC","saturday.pdf","Chastra"},
                          {"RICHARD","sunday.pdf","Chastra"},
                                                   };

	while(i<10 && i>0){
        for(i=0;i<10;i++){
          printf("     %2d.- %s\n",i+1,signo[i][0]);}
        printf("\n\n\n The nunmber of the student you wanna know is: ");
    scanf("%d",&i);
    printf("\n\n\n    ");
    if(i<10 && i>0){
  	  switch(i){
  	  	case 1:
  	    	muestra(signo[i-1][0],signo[i-1][1]);
	        break;
       	case 2:
  	    	muestra(signo[i-1][0],signo[i-1][1]);
	        break;
	    case 3:
  	    	muestra(signo[i-1][0],signo[i-1][1]);
	        break;
       	case 4:
  	    	muestra(signo[i-1][0],signo[i-1][1]);
	        break;
       	case 5:
  	    	muestra(signo[i-1][0],signo[i-1][1]);
	        break;
      	case 6:
  	    	muestra(signo[i-1][0],signo[i-1][1]);
	        break;
    	case 7:
  	    	muestra(signo[i-1][0],signo[i-1][1]);
	        break;
     	case 8:
  	    	muestra(signo[i-1][0],signo[i-1][1]);
	        break;
   	    case 9:
  	    	muestra(signo[i-1][0],signo[i-1][1]);
	        break;
    	case 10:
  	    	muestra(signo[i-1][0],signo[i-1][1]);
	        break;
      	}//end of the switch
        }else{ printf("this number doesnt exist\n"); system("pause");i=10;}
    }
}


  	   


The kind of menu I tried to use was:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <cstdlib>
#include <stdlib.h>
#include <windows.h>
using namespace std;


void elMenu();
void Teams();
void Days();


int main()
{
  int menuChoice;

  while(true)
  {
    elMenu();
    cin >> menuChoice;
    if (menuChoice == 1) Teams();
    if (menuChoice == 2) Days();
    if (menuChoice == 3) break;
  }
}

void elMenu()
{
  cout << "MENU\n"
               "[1] Find for teams\n"
               "[2] Find for days\n"
               "[3] End\n";
}

void Teams()
{
 // here goes my first program
}

void Days()

{
// here will be the second part of my program
}


But it fails miserably
Last edited on
I forgot to say that the PDF´s are just a blank page with the names written.
Topic archived. No new replies allowed.