Answered step by step
Verified Expert Solution
Link Copied!

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 Week9 folder.
Download the files, small_drink_transactions.txt and drink_transactions.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 re-filled 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 X-axis denotes the type of drink and the Y-axis denotes the number sold. There are only 4 types of drink sold, coke, pepsi, sprite, 7up.
Each line in the transaction file contains the name of the drink sold, for example:
pepsi
coke
pepsi
sprite
pepsi
7up
...
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 pseudo-code for opening a transaction file. Get a demonstrator to check your pseudo-code 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

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

Accounting And Auditing Research And Databases Practitioner's Desk Reference

Authors: Thomas R. Weirich, Natalie Tatiana Churyk, Thomas C. Pearson

1st Edition

1118334426, 978-1118334423

More Books

Students also viewed these Databases questions