Write your question here.
I currently working on a code that takes info from files and put it into a string and int classes 2d array. I get the E0349 error when I try to run it, I might just be overthinking it but I'm not sure.
here's my code
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
|
#include<iostream>
#include<iomanip>
#include<string>
#include<fstream>
using namespace std;
//
struct int_string
{
int num;
string heads;
};
int main()
{
int_string chart1[13][6];
int m = 0;
ifstream visitFile("Visitors.txt");
ifstream monthFile("Months.txt");
// 1 display the chart
{
visitFile.open;
monthFile.open;
while (m < 13 && monthFile >> chart1[13][6])
m++;
for (int r = 1; r < 13; r++)
for (int c = 1; c < 6; c++)
visitFile >> chart1[r][c];
for (int x = 0; x < 13; x++)
for (int y = 0; y < 6; y++)
cout << chart1[x][y];
}
}
|
I feel like it would be better if I include the instructions I'm supposed to follow.
Write a C++ program to calculate to analyze the data from the number of visitors to Sleeping Bear Dunes in Michigan in 2015.
Requirements
1. Read the data from the Months.txt and Visitors.txt files. The text files are provided for you to download. The data was obtained from the National Park Service website.
2. Design the program so the user enters a menu item and the following is displayed
a. Display the chart below
b. Totals and display all visitors to the dunes.
c. Total and display each month (add across the rows (except the Total Overnight Stays).
d. Display the percentage of Total Overnight Stays compared to total visits. (Total Overnight Stays/(Recreation Visitors + Total Overnight Stays)
3. Design the program so the user can continuously enter a menu item and terminate the program when done.