Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CODE IN C# ( WHAT IS THE BEST WAY TO USE THE SIMPLE COMBOBOX as a list output when display is pressed? ) Create an

CODE IN C# (WHAT IS THE BEST WAY TO USE THE SIMPLE COMBOBOX as a list output when display is pressed?)

Create an application that keeps track of the total donuts sold, the average donuts sold, and the total of donut sales through the implementation of a List (Do NOT use an Array).

* The form should contain a menu system with the following menu items (the menu items in the Tools menu are all related to the simple combo box for the donut types):

File Tools Help
Exit Add Donut Type About
Remove Donut Type
Clear All Donut Types
Display Donut Type Count

An example is provided below of the form and required message boxes:

Form1 Message Box for Display Donut List Button Message Box for About menu item (use YOUR name)

image text in transcribed

image text in transcribed

* Use a Simple Combo Box to hold the donut types initially populated with Chocolate and Glazed. Make sure and keep the list sorted in ascending alphabetic order as donut types are added (hint: see Sort property of the Simple Combo Box).

Add Donut Type: The user should be able to add to the combo box. Do not allow a blank donut type to be added to the combo box. Display an appropriate message if this occurs. Focus should be returned to the text box portion of the combo box. This should be coded in the Add Donut Type menu item click event handler.

Remove Donut Type: The user should be able to remove a donut type from the combo box. Display an appropriate error message if the user selects Remove Donut Type without first selecting a donut type. This should be coded in the Remove Donut Type menu item click event handler.

Clear All Donut Types: The user should be able to clear all donut types from the combo box. This should be coded in the Clear All Donut Types menu item click event handler.

Display Donut Type Count: The user should also be able to display the count of donut types in the combo box. This should be coded in the Display Donut Type Count menu item click event handler.

* The About menu item under the Help menu should display Your Name in a Message Box. This should be coded in the About menu item click event handler.

* The Exit menu item under the File menu should exit the application. This should be coded in the Exit menu item click event handler.

* Implement a List of whole-numbers (no decimal places) to store the number of donuts entered by the user (Do NOT implement an Array).

* The Calculate button adds the individual number of donuts to the List, calculates the Total of Donuts Sold, Average Donuts Sold, and Total of Donut Sales. The Calculate button should then clear and set the focus to the Number of Donuts text box for the next user entry.

* The Display Donut List button should display the items in the List using a Message Box. The Number of Donuts text box should be cleared and focus set back to it for the next user entry.

* The Clear Donut List button should clear the List, as well as clear the input and output controls and set the focus to the Number ofDonuts text box. It should also set the donut type combo box back to unselected. Counters and accumulators should also be reset where appropriate. DO NOT CLEAR THE DONUT TYPE COMBO BOX.

* Include the following Data Validation and display an appropriate message (Message Box OR ErrorProvider component may be used) and clear and set the focus to the control causing the error (a nested if statement is recommended):

  • Number of Donuts must be a valid data type (i.e., TryParse method)
  • Number of Donuts must be greater than zero (accuracy validation)
  • User must select an item from the donut type combo box (text box portion of combo box should not be blank)

* Add ToolTips to ALL the buttons with descriptive text

* ALL donut types cost .60 (assume all donut types are the same price)

The program must include standard features of a Windows application including:

  • Change the Text property of the form as indicated on the sample form
  • Appropriate naming conventions for all controls
  • Buttons with appropriate name and keyboard access key
  • AcceptButton and CancelButton properties should be assigned to the Calculate and Clear Donut List buttons respectively
  • Appropriate naming conventions and data type declarations for variables
DOX : Donut Calculator File Tools Help Number of Donuts Calculate Select Type of Donut Chocolate Glazed Total of Donuts Sold 24 Average Donuts Sold e Donuts Sold 6 Total of Donut Sales $14.40 Display Donut List Clear Donut List Number of Donuts X TOK DOX : Donut Calculator File Tools Help Number of Donuts Calculate Select Type of Donut Chocolate Glazed Total of Donuts Sold 24 Average Donuts Sold e Donuts Sold 6 Total of Donut Sales $14.40 Display Donut List Clear Donut List Number of Donuts X TOK

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

Environmental Audit Consultant Because Freaking Awesome Is Not An Official Job Title

Authors: Sophia Brown

1st Edition

1083152106, 978-1083152107

More Books

Students also viewed these Accounting questions

Question

Please help me evaluate this integral. 8 2 2 v - v

Answered: 1 week ago