Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The file ( 3 7 . 4 8 2 . 1 6 6 . 3 8 3 . 8 2 3 . 0 6 9

The file (37.4
82.1
66.3
83.82
3.06
9.95
10.05
69.2
83.9
39.87
40.8
21.4
6.66
54.21
11.79
94.2
8.7
15.63) numbers.txt contains a list of floating
point values (1 per line). Write a C++ program to read this file and report the sum of
these values as well as a count of the number of values read. Be sure to explicitly close
the file when reading is complete. 2 points for comments: Every section should have at least a brief description of the lines
that follow. The very top of your code should contain your name, the name of the
program, and a brief description of what the program does and the important variables.
2 points for whitespace: Blank lines should precede all sections of code (compiler
directives like #include statements, variable declarations, calculations, all functions, etc).
Proper indentation must be used as appropriate.
1 point for variable names, constant names, program name, function names: All
variables and constants must be named appropriately. Names should be as short as
possible, while still being descriptive enough for someone else to understand. All
variables should be in lowercase, with the possible exception of the first letter of distinct
words, for example finalBalance. All constants should be in UPPERCASE. Your
program (.cpp file) should have a short, intuitive name. Good program names are
num_sum.cpp, sphere_calc.cpp, and so on. Please do not call it homework4.cpp or
anything similar. The same extends to functions

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

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions