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

  Develop a functional web-based application for a calculator

Develop a functional web-based application for a calculator. It does not need to be live; you can provide JavaScript, CSS, and HTML files. The calculator should successfully complete addition, subtraction, multiplication, and division operations.

  Design pseudocode for application to enter order item

Design the pseudocode for an application that allows a user to enter an order item continuously until a sentinel value is entered.

  Develop two single dimension arrays-floating-point numbers

Develop two single dimension arrays which contain 10 floating-point numbers in each array. Develop third single dimension array to hold sum.

  Explain one new concept learned about arrays

Explain one (1) new concept that you have learned about arrays and one (1) new concept that you have learned about loops as a result of reading the assigned article.

  Write an application that prints out the receipt

Write an application that prints out the receipt details for these shopping baskets...

  Write program to accept a list of student-s name

Write a program that will accepts a list of student's name, individual scores for quiz1, quiz2 and quiz3. Your program should then compute for the average of 3 quizzes.

  Write a program to enter any number of integers in array

Write a program which permits a user to enter any number of integers, which are then stored in the array. After user enters integers, perform the following operations on array.

  Write a method named maxelement

Write a method named maxElement, which returns the largest value in an array that is passed as an argument. The method should use recursion to find the largest element. Demonstrate the method in a program.

  Top-down recursive descent parser

Write a hand-coded top-down recursive descent parser.

  Write pseudocode that takes number entered by user

Write a piece of pseudocode that takes a number entered by the user and prints out every number from that number up to 100 and then prints END.

  Write program to enter name-number of planet from sun

Write down the program which permits the user to enter name of planet, and then prints message stating that planet's number when counted outward from sun.

  Write program to compute amount of money

Write a program that computes the amount of money the computer club will receive from the proceeds of their candy sales project.

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