Question
Write in C++ please. I could really use the extra credit so if you could implement functions for the entire program I would greatly appreciate
Write in C++ please. I could really use the extra credit so if you could implement functions for the entire program I would greatly appreciate it.
For this lab, you will need to implement each of the steps below. It is your choice whether you use functions or not, however, each of the steps below must be implemented properly and your code must compile and run. Students who implement functions for the entire program will receive extra credit. You must also put a comment that indicates which step you are implementing above the code: //Step7
Step 2: Enter the skeleton code into your source file.
#include
#include
using namespace std;
int main(){
system("pause");
return 0;
}
Step 3: Type in the code to declare and initialize an array called qArray that has the following values:
3.7 | 12.3 | 4.5 | 10.6 | 2.3 | 5.4 | 9.8 | 15.2 | 7.7 | 19.8 |
qArray
Step 4: Change the value of the third component in the array to 75.6
Step 5: Print out all of the elements in the array on screen.
Step 6: Change all values under 10.5 to 7.6 using a loop and an if statement.
Step 7: Print out all of the elements in the array on screen.
Step 8: Calculate the sum of all the components and print the sum on screen with an appropriate message.
Step 9: Prints the even numbers in the array and how many even numbers there are with an appropriate message [Hint: How can you determine if a number is even? What is true about all even numbers when compared to uneven numbers? (Hint, hint: think remainders)]
Step 10: Allow the user to change each of the values in the array; Prompt the user to "Enter a value:" and store the value in the array for each component.
Step 11: Print out all of the elements in the array on the screen.
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