Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Chapter 8, Arrays Write a C++ program to do the following 1. 2. 3. 4. 5. 6. Requirements to receive a grade higher than zero

image text in transcribed

Chapter 8, Arrays Write a C++ program to do the following 1. 2. 3. 4. 5. 6. Requirements to receive a grade higher than zero Add a comment to your program including name, date, program name, jag# Output to the screen your name, date, program name, jag# Submit.cpp file and a .jpg showing results Create a user defined function to print an array Declare an array named: alpha, with 10 components of type int Perform the following Initialize each component of alpha to 0 using a for loop, then print all components of the array "Line 1: a) b) Set the value of each component from 1 to 10. alpha[0] would be equal to 1, alpha 1] would be equal to 2, etc. Use a for loop, then print all components of the array: "Line 2: Sum all components of the array using a for-loop, then print the sum: Line 3: " Multiply each component of the array by 2, then print all components of the array: "Line 4:" Change the value of the first component to 10, the fifth component to 5, replace the last component of the array with the sum of the first and fifth component, then print all components of the array: "Line 5: c) d) e) Default Term Browser sh-4.4$ gt+ -o main *.cpp sh-4.4$ main SouthPaw, Line 1: alpha array elements after initalizing : Line 2: alpha array after assignment 1-10: 1 2345678 9 1 Line 3:sum: 55 Line 4: alpha array after multiplying by 2: 2 4 6 8 10 12 14 16 18 29 Line 5: alpha array values after assignments and calculation: 10 4 6 8 5 12 14 16 18 15 sh-4.4$ , main.cpp, Nov 2017, 39999999

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

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions