logo

Farmer's Market Inventory Report

   

Added on  2019-10-09

2 Pages774 Words691 Views
 | 
 | 
 | 
3460:209 Assignment 6-A Assignment 6-A: Farmer’s Market IOverviewThe purpose of this assignment is to make sure that you know how to write a program that uses files and file processing. The program also contains functions and does input, output, flow of control and/or calculations.PROGRAM SPECIFICATIONFor the assignment, we will write a program that reads a file of information pertaining to a Farmer’s Market. The file contains the names of various farms participating in a Farmer’s Market. The program should create a file object for input, read the data, perform some calculations, create a report, and then rewrite the information to a new output file.The format of the file is as follows:Field or data item in the fileData typeNotesFarm nameString of charactersThis could end with a commaCount of itemIntegerNumber of itemsItemString Name of the itemItem priceFloat or doubleUnit cost of each itemDownload the file (called ASSGN6-A.txt) to examine the contents. You should see that the name of the farm is delimited with a comma, and everything else is delimited with a space. When reading the information into your program, the comma after farm name and the spacebetween each remaining field is consistent and guaranteed. Item is also guaranteed to be one word (so probably don’t need a getline). Also, we will not need to validate the information in this program. Valid data is also guaranteed! Your program will read the data items and output them to a report. The count of items should be multiplied by the item price, and that should be shown as well. The format should appear on the screen as follows:=============================================================== FARMER’S MARKET INVENTORY ===============================================================Collins Farm: 43900 tomatoes @ .67 each totaling $29413.00...Rutherford Farms, Inc.: 809 apples @ .90 each totaling $728.10...Grand total: 999999 items totaling $999999.99
Farmer's Market Inventory Report_1

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents