Home CPSC 220

Total Calculation

Objective

To practice using file I/O and output formatting.

Task

Your task for this lab is to write a program that reads in a number of floating point values from a file, adds them together, and then prints out the total.

It must also print out the sales tax on the total at a 5.3% rate, and the final total of the original items + sales tax.

The input is from a file called "items.txt" and the output should be to a file called "total.txt".


Details


Sample Files

Here is a sample items.txt file.

Here is the output that should appear in total.txt.


Submitting

When your program works, email the code to ifinlay@umw.edu.

Copyright © 2018 Ian Finlayson | Licensed under a Creative Commons Attribution 4.0 International License.