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

  There is two part in this assignment1-discussion1-what does

there is two part in this assignment1-discussion1-what does ethics have to do with recruiting and please define ethics?

  Programming language for a new point-of-sale system

You are the lead programmer for a new software project and have been assigned to choose the programming language for a new point-of-sale system

  Write a program that reads data entered at run time

Write a program that reads data entered at run time consisting of positive integers and averages them -

  Create security code program-display digit-ascii character

You have been hired to create the security code program. Program must permit user to enter message, one character at a time.

  Program to read employee information into array of objects

Consider a program that will read employee information into an array of objects, sort the array by employee identification number, write out the sorted array.

  Develop console application to generate random number

Develop C++ console application which generates the random number which should be guessed by user. Program will indicate to user if their guess is correct, too high or too low.

  Develop a domain-specific language within ruby

Develop a domain-specific language within Ruby, such as for manipulating files in a directory system, editing files, generating quizzes, describing graphical or geographical scenes, and adding and viewing entries in a calendar.

  Design algorithm to will read file and produce weekly report

Design an algorithm that will read file and produce a weekly report of the net earnings for those employees. Net earnings are gross earnings minus deductions.

  Create a rexx program

Create a REXX program that asks a user for four separate lines of input, and then outputs those lines all at once, one line at a time

  Create structure chart-flowchart to store taxpayer-s name

Create the structure chart, also a flowchart and pseudocode, for following problem. Suppose that each input record contains taxpayer's name.

  What programming language did grace hopper invent

What programming language did Grace Hopper invent. What was the name of the network begun in 1969? What does it stand for

  Program to display total sales salesmen

Display total sales per (6) salesmen. Place first and last names for (6) salesmen in array. When you display your final output, print salesman's last name only.

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