Application that calculates the cost of all the supplies

Assignment Help Programming Languages
Reference no: EM13933138

Write an application that calculates the cost of all the supplies added to the user's shopping list (Fig. 22.18). The application

should contain two Li stBoxes. The first contains all the supplies offered and their respective prices. Users should be able to

select the desired supplies from the first Li stBox and add them to the second Li stBox. Provide a Calculate Button that

displays the total price for the user's shopping list (the contents of the second ListBox).

a) Copying the template to your working directory. Copy the directory C: ExamplesTutori al 22Exerci sesSuppl yCal cul ator to

your C: Si mpl yVB2008 directory.

b) Opening the application's template file. Double click Suppl yCal cul ator. sl n in the Suppl yCal cul ator directory to open the

application.

c) Adding code to the Add >> Button. Double click the Add >> Button to create an empty event handler. Insert code in the

event handler that adds the selected item from the first Li stBox to shoppi ngLi stBox. Be sure to check that an item is selected

in the first Li stBox before attempting to add an item to shoppi ngLi stBox.

d) Enabling the Buttons. Once the user adds something to the shoppi ngLi stBox, set the Enabl ed properties of the <<

Remove and Calculate Buttons to True.

e) Deselecting the items. Once the item is added to the shoppi ngLi stBox, make sure that it is deselected in the stockLi

stBox. Also, clear the Total: Label to indicate to the user that a new total price must be calculated.

f) Adding code to the << Remove Button. Double click the << Remove Button to create an empty event handler. The Items in

your list: Li stBox's Sel ecti onMode property has been set to Mul ti Extended to allow the user to select multiple items. Use a

Do Whi l e loop to remove any selected items in the shoppi ngLi stBox. Be sureto check that at least one item is selected

before attempting to remove an item. [Hint:Method shoppi ngLi stBox. Items. RemoveAt(i ndex) will remove the item located

at i ndex from the shoppi ngLi stBox. When an item is removed, the Sel ectedIndexproperty points to the next selected item,

if there is one.] If there are no items remaining in the shoppi ngLi stBox, disable the << Remove and Calculate Buttons.Also,

clear the Total: Label to indicate to the user that a new total price must be calculated.

g) Adding code to the Calculate Button. Double click the Calculate Button to create an empty event handler. Use a For... Next

statement to loop through all the items in the shoppi ngLi stBox. Convert each item from the Li stBox into a Stri ng. Then use

the Stri ng method Substri ng to extract the price of each item.

h) Displaying the total. Convert the Stri ng representing each item's price to a Decimal , and add this to the overall total (of

type Deci mal ). Remember to output the value in currency format.

i) Running the application. Select Debug > Start Debugging to run your application. Use the Add >> and << Remove Buttons to

add and remove items from the Items in your list: Li stBox. Click the Calculate Button and verify that the total price displayed

is correct.

j) Closing the application. Close your running application by clicking its close box.

k) Closing the IDE. Close the Visual Basic IDE by clicking its close box.

1103_p1.png


Attachment:- Tutorial22.zip

Reference no: EM13933138

Questions Cloud

Present value of your windfall if appropriate discount rate : You have just received notification that you have won the $2.13 million first prize in the Centennial Lottery. However, the prize will be awarded on your 100th birthday (assuming you’re around to collect), 67 years from now. What is the present value..
Discussing the source and derivation of income principles : Based on this conclusion and discussing the source and derivation of income principles, state which amounts would be included in his assessable income for the year. You do not need to consider the consequences of any Double Tax Agreements.
Possible justifications for attorney-client privilege : Explain what the spousal incapacity privilege is and the rationale behind the rule. What is the marital communications privilege and what is required for the privilege to apply? What are two possible justifications for the attorney-client privilege
What is the expected return and standard deviation : What is the expected return and Standard Deviation of a $10,000 portfolio in which you expect to 5% return and a standard deviation of 20%? Assume 1% risk free rate.
Application that calculates the cost of all the supplies : Write an application that calculates the cost of all the supplies added to the user's shopping list (Fig. 22.18). The application should contain two Li stBoxes. The first contains all the supplies offered and their respective prices. Users should ..
What is the debt-to-equity ratio : Debt-to-Equity Ratio Will Able Corporation's balance sheet showed the following amounts: Current Liabilities, $24,505; Bonds Payable, $18,000; Lease Obligations, $24,183; and Notes Payable, $6,595. Total stockholders' equity was $36,100. Required: Wh..
Which of the three types of preference toward risk : Which of the three types of preference toward risk (averse, neutral and seeking) understand that is best suited to maximize the profits of an enterprise? There is a preference that is better than the other?
Calculate breakeven point in units at each of selling prices : The Pointer Appliance Company is investigating the additional of a new and improved pulsating blender to its line of consumer appliances. The product chops, grinds, grates and blends smoothies twice as fast as all other blenders on the market. The bl..
Explore facebook paying close attention to how technology : Explore the Facebook paying close attention to how the technology enables the members of Facebook to communicate and collaborate. What findings show how the collaboration theory is being used within Facebook to keep members engaged in the communic..

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd