Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CMPSC 201 - Fall 2018 Lab 8 To be done individually Due by the end of your class time on 11/2/18 Goals: Practicing functions using

image text in transcribed
CMPSC 201 - Fall 2018 Lab 8 To be done individually Due by the end of your class time on 11/2/18 Goals: Practicing functions using arrays as parameters Proble: Redo (or do for the first time) Labs 4-7 makeup with a function to read the information from the file and a second function to output the values to a file. (you should have 3 function total: the main function, the function to read from a file and a function to output). The function to read values from a file should accept an array and the maximum number of values that may be stored in the array as input. values in the file to main. This function should return the number of The function to output the values to a file should accept three parameters: an array, the number of values that are actually stored in the array, and the number of values that should be output per line (for the makeup lab this was 5). The values should be output using a single loop (no nested loops) which contains output statements and a simple if (no else or if-else branches). (You may find the example from lecture 9/22/18 useful). The main function should declare an array, call the function to fill the array and output to the screen how many values are in the array. Next the main function should prompt the user to enter the number of values that should be output per line. You should assume that the user enters a whole number between and 7 inclusive. Finally the main function should call a function to output the values in the array Carefully consider what values need to be passed to the functions and what values should be defined locally within each function. Remember that your function definitions should appear after main and your program should contain the usual introductory comments at the beginning of the file plus comments specific to each function immediately before that function. The function comments should contain the purpose of the function, input needed (passed to the function and/or interactive input within the function), output from the function (returned back to the function call and/or output to screen), and processing (how to get the output from the input). Do not use any concepts beyond Chapter 8 of your textbook. Remember to confirm all your submissions to Canvas. You may make multiple submissions to the same drop box and the last submission will be graded. Follow the Assignment Guidelines posted on Canvas

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

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

More Books

Students also viewed these Databases questions

Question

=+ What skills and competencies will enable someone

Answered: 1 week ago

Question

=+to live and work wherever he or she wants?

Answered: 1 week ago

Question

=+How will this affect the recruiting process?

Answered: 1 week ago