-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
98 lines (56 loc) · 1.6 KB
/
main.cpp
File metadata and controls
98 lines (56 loc) · 1.6 KB
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
74
// Main.cpp: This file contains the 'main' function. Program execution begins and ends here.
#include <iostream>
#include <fstream>
#include <array>
#include <string>
#include <cmath>
#include <stdexcept>
#include "DS_1.h" // Include the header file for DS_1.cpp
#include <string>
//
using namespace std;
int main() {
//feed in the array size and then the function creates the array
int s = 100;
int* arrayy = new int[s];
string name;
cout << "Enter in the name of the file you would like to read that has 100 integers in total" << endl;
cin >> name;
readingFile(name, s, arrayy);
//eventually modify this code
char choice = 'C';
char userChoice = 'C';
// ... Your existing code ...
while (choice != 'X' && choice != 'x') {
showMenu();
cin >> choice;
char userChoice = toupper(choice);
switch (userChoice) {
case 'R':
replaceValue(arrayy);
//call
break;
case 'F':
find(arrayy);
break;
case 'M':
char input;
int indexx;
cout << "Do you know the index of the value you are looking for? y/n";
cin >> input;
if (toupper(input) == 'Y') {
cin >> indexx;
modifyInteger(arrayy, indexx);
}
// else if (toupper(input) == 'N') {
// modifyInteger(arrayy);
// }
break;
case 'A':
addToArray(arrayy);
break;
}
}
// ... Your existing code ...
return 0;
}