Ask DOT NET Expert

INSTRUCTIONS: Using C# - All work must be in the Main

You will be asking the user for a comma-separated list of items they wish to purchase.

a. Validate this to make sure it is not left blank.

b. Send this text string into the custom function PurchaseToArray.

Create a custom function named PurchaseToArray that will split apart the user's list text string into an array of individual items.

a. Make sure to remove any spaces before or after the item itself. b. Return this array of items to be purchased to the Main method.

Once you have the string array of items back in your Main Method create a 2nd custom function called PurchaseCosts.

a. This function should accept the string array of items.

b. Inside of this function create an array to hold the costs of these items.

i. Note the length of this ArrayList must be depended on how many items the user typed in. AKA do NOT hard-code this.

c. Loop through the items array and prompt the user for the cost of each item in the array.

i. Validate that the user is typing in a valid response.

ii. Once it is valid store this cost inside of the cost array.

d. After you get each cost, Return this array to the Main.

After catching the returned cost Array, create one last custom function called SumOfCosts.

a. This array should accept the cost array as a parameter.

b. Inside of this function create a variable to hold the total sum of the items costs. c. Loop through each item in the cost Array and add their total to the sum.

d. Return this sum to the Main method.

Use the total sum variable that is return in a final output to the user that is in this format.

a. "The total cost of all of your items is $X."

i. Where X is a formatted text string that contains the cost rounded to 2 digits.

DOT NET, Programming

  • Category:- DOT NET
  • Reference No.:- M93071879

Have any Question?


Related Questions in DOT NET

Assignment specificationthis assignment is split into two

ASSIGNMENT SPECIFICATION This assignment is split into two documents. 1. Assignment Specification. This document contains the specification for what you will be required to do. 2. Assignment Addendum. This document conta ...

Scenariouser modelling inc would like to organize a series

Scenario User Modelling Inc. would like to organize a series of conferences focusing on research topics in the area of user adaptive systems and personalization. They need to organize annual conferences for researchers a ...

Casewe sell pdfs from our site and pdfs can be ordered from

Case We sell pdf''s from our site and pdfs can be ordered from the site by selecting a book, putting it in a shopping cart, then signing in with a password or as a guest, and then checking out. For some reason, when a pu ...

Summarythis assessment requires you to develop a simple

Summary This assessment requires you to develop a simple text editor with a basic offline user login. It is a windows application that will allow new uses to be added, existing users to login, and to create/save/edit tex ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As