Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab 6 . Arrays and Searching 1 . Write a C + + program to find the sum of one dimensional float array. 2 .

Lab 6. Arrays and Searching
1. Write a C++ program to find the sum of one dimensional float array.
2.(Optional)Write a C++ program to swap first and last element of one dimensional integer array.
3.(Optional) Write a C++ program to reverse the element of one dimensional integer array.
4.
Write a C++ program to find the largest and smallest element of a float array. Use for loop to search largest and smallest element in this float array.
5. S is one-dimensional array of integers. Write a C++ function to search for an element in array S which is greater than integer num by using for loop. Use integer num and array as two parameters of your function ( bool searchbig(int, int [MAXELS]); ). If the element in array S which is greater than integer num is found in the array then the function should return true and false otherwise.
Call this function from main() function.
6. Write a C++ function to calculate and return the average of one dimensional integer data type array. Your functions parameter list should receive two parameters: an array of arbitrary size and the size of the array. Use for loop to calculate the sum of each element in array (like question 1). We can get the average by using sum divided by the size of array. Return this average.

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

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions