Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include using namespace std; class Data { private: int values[5]; int size = 5; public: //desc: default zero argument constructor //pre: none //post: values array

#include using namespace std;

class Data { private: int values[5]; int size = 5;

public: //desc: default zero argument constructor //pre: none //post: values array initialized to values 0 to 4 Data() { for (int i = 0; i

//desc: calculates the sum of the values array //pre: values is initialized //post: sum of values array returned int getSum() { int total = -1; for (int i = 0; i

//desc: size accessor function //pre: size initialized to some value //post: return size int getCount() { return size; } };

//desc: computes the average from the sum and count //pre: sum and count must be initialized //post: average is returned double compute_average(int sum, int count) { return sum / count; }

//desc: main function //pre: none //post: average of values array displayed to screen with size of array int main() { Data d; cout

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

References Mailings Review View Help Tell me what you want to do CIS 200 - LAB 2 Debugging and Multidimensional Arrays Due: 3 February 2020 PART A: DEBUGGING IN VISUAL STUDIO This lab is designed to introduce you to the 1. Copy the following code without changes in to a new project in visual studio. tinclude using namespace std; class Data private intva values[5]; int size - 5; public: //desc: default zero argument constructor //pre: none /post: values array initialized to values a Data() for (int i = 0; i using namespace std; class Data private intva values[5]; int size - 5; public: //desc: default zero argument constructor //pre: none /post: values array initialized to values a Data() for (int i = 0; i

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

The Database Factory Active Database For Enterprise Computing

Authors: Schur, Stephen

1st Edition

0471558443, 9780471558446

More Books

Students also viewed these Databases questions