Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code Blocks, C++. The last txt. file pic is just for additional info, if needed, Thanks;) 3460:209 Assignment 7-B Assignment 7-B: Farmer's Market Selection Sort

image text in transcribedimage text in transcribedimage text in transcribed

Code Blocks, C++. The last txt. file pic is just for additional info, if needed,

Thanks;)

3460:209 Assignment 7-B Assignment 7-B: Farmer's Market Selection Sort Overview The purpose of this assignment is to make sure that you know how to write a program that and may perform input, output, files and file processing, flow of control, and/or calculations. Please note that this assignment indicates precisely what your program should accomplish, without a precise indication of how the program works. Part of your assignment is designing the techniques of how the program works. PROGRAM SPECIFICATION For the assignment, we will read the updated file of information about the Farmer's Market that you created in Assignment6-A. Recall that the file contains the names of various farms participating in a Farmer's Market. The created output from your previous assignment should have rewritten the information in this format Field or data item in the fileData type Farm name Notes String of characters This could end with a comma Integer String Float or double Float or double Number of items Name of the item Unit cost of each item The unit cost count of items Count of item Item Item price Total price Reminder that when reading the information into your program, the space between each field should have remained consistent and guaranteed. Also, we will not need to validate the information in this program Your program will read the file and report on each item's total contribution to the Farmer's Market. So if there are 2 like items (i.e., there are 2 records for that item), you will add each contribution in running totals and report that. If there's only one that's easy, it's just that one as the total Since the file is sequentially ordered by the farm names, we will need to perform a sorting operation. We will need to sort by the item name so we can group and compare. You will need to write a selection sort and sort the file as an array. You will use the item as the sort value/key. You will need to read the file and place the name of the items into an array (you only need the items), then perform a selection sort on the array, and then read the sorted array and count up the number of times each item appears. As you read the sorted array, the results should be displayed in a report 3460:209 Assignment 7-B Assignment 7-B: Farmer's Market Selection Sort Overview The purpose of this assignment is to make sure that you know how to write a program that and may perform input, output, files and file processing, flow of control, and/or calculations. Please note that this assignment indicates precisely what your program should accomplish, without a precise indication of how the program works. Part of your assignment is designing the techniques of how the program works. PROGRAM SPECIFICATION For the assignment, we will read the updated file of information about the Farmer's Market that you created in Assignment6-A. Recall that the file contains the names of various farms participating in a Farmer's Market. The created output from your previous assignment should have rewritten the information in this format Field or data item in the fileData type Farm name Notes String of characters This could end with a comma Integer String Float or double Float or double Number of items Name of the item Unit cost of each item The unit cost count of items Count of item Item Item price Total price Reminder that when reading the information into your program, the space between each field should have remained consistent and guaranteed. Also, we will not need to validate the information in this program Your program will read the file and report on each item's total contribution to the Farmer's Market. So if there are 2 like items (i.e., there are 2 records for that item), you will add each contribution in running totals and report that. If there's only one that's easy, it's just that one as the total Since the file is sequentially ordered by the farm names, we will need to perform a sorting operation. We will need to sort by the item name so we can group and compare. You will need to write a selection sort and sort the file as an array. You will use the item as the sort value/key. You will need to read the file and place the name of the items into an array (you only need the items), then perform a selection sort on the array, and then read the sorted array and count up the number of times each item appears. As you read the sorted array, the results should be displayed in a report

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

2nd Edition

1597499471, 978-1597499477

More Books

Students also viewed these Databases questions

Question

Different formulas for mathematical core areas.

Answered: 1 week ago