Pure Programmer
Blue Matrix


Cluster Map

Project: Total Filter (Floating Point)

Write a filter program that accepts text representations of floating point values, one per line, and then computes and prints the total. The program should print an error to STDERR if a line of input can't be parsed as a floating point value.

Output
$ g++ -std=c++17 TotalFilterFP.cpp -o TotalFilterFP -lfmt $ ./TotalFilterFP < ../../data/text/FPList1.txt 520.24 $ g++ -std=c++17 TotalFilterFP.cpp -o TotalFilterFP -lfmt $ ./TotalFilterFP < ../../data/text/FPList2.txt 50273.8 $ g++ -std=c++17 TotalFilterFP.cpp -o TotalFilterFP -lfmt $ ./TotalFilterFP < ../../data/text/FPList3.txt 4.99077e+06

Solution