Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write C++ statements which declare the parkingSpots as a of type two-dimensional int array, sized NUM_OF_ROWS by NUM_OF_COLS, then write another statement which calls

1. Write C++ statements which declare the parkingSpots as a of type two-dimensional int array, sized NUM_OF_ROWS by NUM_OF_COLS, then write another statement which calls the function from the previous problem with this new array.

2. Write the C++ definition of a void function with a single formal parameter of type two-dimensional int array, sized NUM_OF_ROWS by NUM_OF_COLS. Assume NUM_OF_ROWS and NUM_OF_COLS are defined integer constants. Have the function read from common input in order to fill the contents of the array which is passed in.

3.

3. Given the following C++ code

char name[8];

strcpy(name, " Robert");

mark the following statements as Yes if they precisely output Robert. Otherwise, mark the statement as No and explain the reason why.

a. cout << name;

Answer:

b. for(int j = 0; j < 5; j++)

cout << name[j];

Answer:

c. int j = 0;

while(name[j] != '\0')

cout << name[j++];

Answer:

d. for(int j = 0; j < 8; j++)

cout << name[j];

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions