Question
Write a C++ program that declares two arrays (one-Dimensional)alphaandbetaof 50 components of typedouble. Initialize the array usinginitializeArray()so that the first 25 components are equal to
Write a C++ program that declares two arrays (one-Dimensional)alphaandbetaof 50 components of typedouble.
Initialize the array usinginitializeArray()so that the first 25 components are equal to the square of the index variable, and the last 25 components are equal to three times the index variable.
Output thealphaarray usingprintArray()so that 10 elements per line are printed.
copy the values from thealphaarray to thebetaarray usingcopyArray().
Output thebetaarray usingprintArray()so that 10 elements per line are printed.
Use the following three function names (defineinitializeArray(),printArray(), andcopyArray()):
main()- Declare thealphaarray andbetaarray.
initializeArray()- fillthealphaarray.
printArray()- Print thealphaarray andbetaarray. Use the tab between numbers.
copyArray()- copy the values from thealphaarray to thebetaarray.
***Do not use any pre-definedfunctions that were not covered in the class.
***Use only topics that were covered in the class.
***No object-oriented programming.
***Match the output below (OUTPUTS section).
Submit your source code (file name is Assignment_15_yourLastName.cpp). Make sure that it compiles using Code::Blocks.
If it doesn't compile, you will lose 50%. Improper indentation: -20%
If it doesn't produce the required results: -30%. Formatting output: -20%
Do NOT compress the file.
**************************************************************************************
OUTPUTS:
Program output (Use the tab between numbers.):
**************************************************************************************
The output of the alpha array:
0 1 4 9 16 25 36 49 64 81
100 121 144 169 196 225 256 289 324 361
400 441 484 529 576 75 78 81 84 87
90 93 96 99 102 105 108 111 114 117
120 123 126 129 132 135 138 141 144 147
The output of the beta array:
0 1 4 9 16 25 36 49 64 81
100 121 144 169 196 225 256 289 324 361
400 441 484 529 576 75 78 81 84 87
90 93 96 99 102 105 108 111 114 117
120 123 126 129 132 135 138 141 144 147
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