Question: C++: How to fix this error message in my code? The error message: =================== MISMATCH FOUND ON LINE 0002: =================== ACTUAL : The~total~was~0 EXPECTED: Enter~a~weight~(0~to~stop):~2

C++: How to fix this error message in my code? The error message:

=================== MISMATCH FOUND ON LINE 0002: ===================

ACTUAL : The~total~was~0

EXPECTED: Enter~a~weight~(0~to~stop):~2

======================================================

My code:

#include #include using namespace std; int main(){ double array[20]; double average=0,sum=0; int index=0; int counter=0; while(1){ double n; cout<<"Enter a weight (0 to stop): "; cin>>n; cout<

average=sum/index; cout<<"The total was "<

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!