Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Graphing Application. Create a new C# . NET solution and save it in your Week 9 folder. Download the files, small _ drink _ transactions.txt
Graphing Application. Create a new C# NET solution and save it in your Week folder.
Download the files, smalldrinktransactions.txt and drinktransactions.txt from from Moodle. For testing purposes you should use the small transactions file. Use the main transactions file when you think the application works correctly. To see what is in the files just open them in Wordpad or Visual Studio.
Bluebird vending operates drink vending machines which sell a variety of bottles of drink. Each time a drink is sold the vending machine adds the drink sold to a transaction file stored in the internal memory. The vending machine is refilled each week and the transaction file is downloaded.
The manager wants you to write an application which will process the transaction file to sum up the number of bottles of each type of drink sold and then display the number sold as a bar graph in a picturebox. The Xaxis denotes the type of drink and the Yaxis denotes the number sold. There are only types of drink sold, coke, pepsi, sprite, up
Each line in the transaction file contains the name of the drink sold, for example:
pepsi
coke
pepsi
sprite
pepsi
up
The application should allow the user to open the transaction file to process, clear the graph, and exit from the application. You can use a menu or buttons to allow the user to perform these tasks.
Write the pseudocode for opening a transaction file. Get a demonstrator to check your pseudocode before going on to the next step and save it to your project folder.
Create the event methods which will clear the graph and exit from the application.
a b
Introduction to Programming Practicals
c Create a method called CalcBarHeight which is passed the number of drinks sold and returns back the height of the bar in the graph. You will need to use the height of the picturebox and will need to scale the height appropriately.
d Write the code for opening a transaction file based on your pseudo code from a Use the method from c to calculate how high each bar of the graph should be
You are not required to label your graph with text to get the practical marked but if you want to try to add text to label your graph you will need to use the DrawString method of the Graphics object. See if you can figure out how to do this if you have time.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started