-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.cpp
More file actions
61 lines (46 loc) · 936 Bytes
/
Menu.cpp
File metadata and controls
61 lines (46 loc) · 936 Bytes
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
#include <iostream>
#include <cstdlib>
#include <string>
#include "Menu.h"
using namespace std;
int slength(string v []){
return sizeof(v) / 2;
}
Menu::Menu(string nome){
setNome(nome);
}
void Menu::setNome(string _nome){
nome = _nome;
}
void Menu::getNome(){
cout << nome << endl;
}
void Menu::setItens(string v[]){
numItens = slength(v);
cout << numItens << endl;
itens[numItens];
subItens[numItens];
for(int i = 0; i < numItens; i++){
itens[i] = v[i];
}
}
void Menu::getItens(){
for(int i = 0; i < numItens; i++){
cout << itens[i];
}
cout << endl;
}
void Menu::setSubItens(int indice, string v[]){
int tamanho = slength(v);
subItens[indice][tamanho];
for(int i = 0; i < tamanho; i++){
subItens[indice][i] = v[i];
}
}
void Menu::getSubItens(int indice){
int tamanho = slength(subItens[indice]);
for(int i = 0; i < tamanho; i++){
cout << subItens[indice][i] << "\n";
}
cout << endl;
}