Step 1: take a breath.
Step 2: please, tell me your teacher has never taught you to write that:
const char DAY = 7["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
(hint: try this way (just an example):
1 2
|
const char * DAY[] = { "Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday", "Sunday" };
|
Step 3: please, inform us if you’re allowed to use std::string and std::vector (you included <array>…).
Step 4: have a look at your
getCity() function:
1 2 3
|
void getCity(int temperature)
{
int temperature[CITY][WEEK];
|
If it has got
int temperature as an argument, you can’t redefine it as a 2D C-style array immediately after.
Step 5: please, have a look at your
getName() function:
1 2 3 4 5
|
const int CITY = 2;
. . .
void getName(int CITY)
{
if (CITY == 1)
|
You’re hiding a global variable - well, ok, that’s nothing bad in that, but I wonder if you’re doing that on purpose…
Step 6: there’s a number of errors in your code. Please let us know if:
- you feel confident with C-style arrays (pointers vs arrays, array of pointers, 2d-arrays...);
- you know about function parameters, function prototypes, scope…;
- is this an assignment?