CPP
cpp
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
/*THIS CODE WILL TAKE THE USER'S NAME TO CALL THE USER BY THEIR NAME
GIVE THE USER A "LUCKY" NUMBER
AND A DIFFERENT FORTUNE EVERY TIME THE PROGRAM RUNS.*/
#include <iostream>
#include <fstream>
#include <string>
#include <ctime>
using namespace std;
//Functions for entering a name, and creating an array
//with the fortunes from the text file.
void nameEnter();
int randNum();
void fortArray(string theArray[], const int size);
void randFort(const string theArray[]);
int main() {
//Creates the Array for the fortunes.
const int size = 2195; //Size from the lines in the file.
string fArray[size];
cout << "Welcome to my Program!" << endl;
//Calling the functions.
nameEnter();
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run