Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise #3: SubTotal Write a function named subtotal takes as its arguments the following . a one dimensional array of floating point values an integer

image text in transcribed
Exercise #3: SubTotal Write a function named "subtotal" takes as its arguments the following . a one dimensional array of floating point values an integer that tells the number of cells in the array The function should replace the contents of each cell with the sum of the contents of all the cells in the original array from the left end to the cell in question. Thus, for example, if the array passed to the function looks like this: 5.8 I 2.6 I 9.1 I 3.4 I 7.0 Then when the function returns, the array will have been changed so that it looks like this 5.818.4117.51 20.9127.9 Note that the contents of cell 0 are not changed. The function should not return a value. Write a 2 main program that tests and validates the subtotal function Sample input /output: lease enter the number of values in the array: 5 lease enter the values for your array: 1 2 3 45 15

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 Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago