Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i have to get the sum of input04.txt. when i run the code, then i got -1. but i need the sum of entering number(user

image text in transcribedimage text in transcribedimage text in transcribedi have to get the sum of input04.txt.

when i run the code, then i got -1. but i need the sum of entering number(user input in terminal) which is 2,4,1,3 for this case.

how can i bring and use the input numbers to make sum()?

could you please fix the sum function that i can get correct sum result?

and please fix the driver() as well. thank you.

(runProgram.c has just driver() only in it)

void driver () \{ int anumber =1; promptList( ); while ( (anumber = getintegerLine ())>=0) \{ dk908970csci-vcf0: /1730b/04-Lab03\$./runProgram (az) : Entered >2 Running Average 2.00 Entered >4 Running Average 3.00 Entered 1 Running Average 2.33 Entered ---> 3 Running Average 2.50 End of input Summary Statistics: Sum: -1

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

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

What is the main advantage to this tactic?

Answered: 1 week ago