Array operations. Define two array of integer numbers (A and B) of size 10 each.
ID: 3570467 • Letter: A
Question
Array operations. Define two array of integer numbers (A and B) of size 10 each. Fill the array A with the first 10 values of the column A, and the array B by asking the user to enter each of the 10 elements. The sheet must show three buttons, each one to perform one of the following operations:
A) calculate A=A+B (sum of array A and array B, the result will be stored in array A)
B) Calculate A.B (Scalar product of array A and array B)
C) Clear the data from the sheet
Explanation / Answer
#include using namespace std; int main() { int input, remainder, even = 0, odd = 0; int evenArray[even]; int oddArray[odd]; cout > input; while (input != 0) { remainder = input % 2; if (remainder == 0) { evenArray[even] = input; even++; } else { oddArray[odd] = input; odd++; } cout > input; } coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.