Question: Program 1 #include #include using namespace std; int main() { int size; //Section 1 - Array Definitions int readings[-1]; float measurements[4.5]; string names[size]; //Section 2

Program 1

#include

#include

using namespace std;

int main()

{

int size;

//Section 1 - Array Definitions

int readings[-1];

float measurements[4.5];

string names[size];

//Section 2

const int SIZE = 100;

int numbers[SIZE];

for (int i = 1; i <= SIZE; i++)

numbers[i] = i;

}

Questions: 1) In the lines under the comment labeled Section 1, what is incorrect about these variable declarations? Rewrite the lines so that they are valid C++ statements that will compile. 2) Under Section 2, is there a problem with these lines of code? If so, how do you fix them?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!