Question: CS 3 0 1 Data Structures and Algorithms Homework 1 The purpose of Homework 1 is brushing up C + + skills and warming up
CS Data Structures and Algorithms
Homework
The purpose of Homework is brushing up C skills and warming up for future programming
assignments. Vectors are not allowed. Linkedlist in C library should not be used. The program
has the following functionality:
Once it starts, it takes the input file name as an argument from commandline.
The program uses the file name to open the file. The file has a number of lines. Each line has
two numbers separated by a comma. Therefore, there are actually two columns of numbers.
For example:
The program processes the input data to calculate the average value of all valid numbers in
the first column and the largest value of all valid numbers in the second column. The print
out should be
The average value of all numbers in the first column: XXXXXXX
The largest value of all numbers in the second column: XXXXX
The total number of rows in the file is: XXXX
The invalid numbers are: XXX XXX XXX
Requirements:
will be if it does not compile or crash when make it The homework must be done in
C and compatible to C Your submission must be in a zip or tar.gz file. You
homework must be compiled and run using the given Makefile. Failing to meet the
requirements in this section will result in
The Following identification information must be included at the beginning of your cpp
file.
Name: XXXXXXX
NetID: ab
Email: XXXX@csueastbay.edu
The output average value should retain decimal digits.
The program must use cin and cout to deal with command line input and output.
The program must ask user to input again without crashing file name is invalid.
You can only use array no vectors, no linked list, actually you also can do it only with
loops... to solve this.
Students must implement loops by themselves to calculate the average and to find
the largest value, invalid numbers, and number of rows.
There are invalid numbers like P in the input data file, make sure those
numbers will be recognized and abandoned automatically by your program without crashing.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
