Question: I have a Computing 1 test on Tuesday I would like help with the past paper I am working on this question: A. Write an

I have a Computing 1 test on Tuesday

I would like help with the past paper I am working on this question:

A. Write an algorithm / pseudocode that declares an array/list of strings

and prints only those strings that contain a number. No C++ code is required for this question.

Example:

Input : purple, orange4, bl2ue, tan, red

Output: orange4, bl2ue

B. What is the output from the following C++ program?

#include

using namespace std;

int fun(int = 0, int = 0);

int main() {

cout << fun(5); return 0; }

int fun(int x, int y) {

return (x+y);

}

a. Compiler error

b. 5

c. 0

d. 10

c. What is the output from the following C++ program?

#include

using namespace std;

int array1[] = {200, 400, 300, 600, 500};

int array2[] = {10, 20, 30, 40, 50};

int temp, result = 0;

int main() { for (temp = 0; temp < 5; temp++) {

result += array1[temp];

}

for (temp = 0; temp < 4; temp++) {

result += array2[temp];

}

cout << result;

return 0;

} a. 2500

b. 2100

c. Error

d. 1650

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Lets tackle each part of the question stepbystep Part A Algorithm Pseudocode We need to create an algorithm or pseudocode that declares an array or li... View full answer

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!