Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with this c++ task, please statement Purpose: Purpose of this Lab is to familiarize the students with the use of elementary data
I need help with this c++ task, please
statement Purpose: Purpose of this Lab is to familiarize the students with the use of elementary data structure- Arrays. Another aim is to teach the students how to implement one dimensional and two- dimensional arrays. The students are given small tasks related to 1-D and 2-D arrays which they complete during the lab session under the supervision of the lab instructor. This helps them understand the concepts well which they learn in their lectures. Activity Outcomes: The students will learn how to write methods related to some actions performed on 1-D and 2-D arrays. They will understand how to write simple methods to calculate average of all elements of 1-D array and display how many elements are below and how many are above this average. count and display how many elements in 1-D array are even and how many are odd. find and swap the largest and smallest elements in 1-D array. find and display sum of each row and each column of 2-D array. display elements of row which has the largest sum of elements. display row(s) which contain(s) repeated elements. Theory Review (10 Minutes): Since an array is the basic data structure, the students are already familiar with in their previous courses, nothing can be added here as a review of this data structure. We shall practice solving some exercises related to 1-D and 2-D arrays. Practice Activity with Lab Instructor: Problem Statement: We want to create a program that will store random integers between 0 and 99 in a two dimensional array. The program should find and display sum of all elements stored in the array. Solution: Create a project with the name "ArrayProject" Inside this project, create a main class with the name SumElements and add the following code in this class main.cpp int row; 1 #includeStep 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