Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions

Question

Prove that if n is a positive integer then 7n 1 is divisible by 6.

Answered: 1 week ago

Question

List appropriate benchmarks for each of the ratios calculated.

Answered: 1 week ago