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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started