Create a c# program that includes a coffeeorder class

Assignment Help DOT NET Programming
Reference no: EM13775014

Create a program that includes the following requirements: Create a CoffeeOrder class
Private class members for:
order number
ingredient
constant double PRICEOFCOFFEE = 1.95
constant double price additives for cream and sugar, cream and artificial sugar, milk and sugar, milk and artificial sugar at.25, .40, .30, .40 respectively.
double order price
other class variables as needed
Public class methods:
a method to get the data for each individual CoffeeOrder object in the array of objects instantiated in Main.
the CoffeeOrder get data method will present a menu that looks like the following:
You are ordering a fine cup of coffee. What would you like in your coffee?

1. Black

2. Cream & Sugar, add 25 cents

3. Cream & Artificial Sweetener, add 40 cents

4. Milk & Sugar, add 30 cents

5. Milk & Artificial Sweetener, add 40 cents

Please enter your selection from 1 to 5:

Pass the counter into the get data method by reference from Main. The get data method will implement a sentinel while loop that will take an uppercase Y character entry regardless of whether y or Y is entered. In the loop, present the menu, take and convert the selection and evaluate the selection based on the ingredient additive combination entered. Based on the additive combination you will determine the total price of the cup for the current coffee object by adding the indicated additive constant to the PRICEOFCOFFEE constant. If the selection was 1 then black coffee was selected and you assign the PRICEOFCOFFEE value to the total price for a cup. The while loop will continue to take new coffee object orders until an N or n is entered. Within the selection statements you will first set the order number class variable equal to the object array index counter passed into the method from Main. If an incorrect selection is made remember to prompt the user regarding the incorrect coffee selection and present the selection menu again.

A display data method that will display the order number (make sure you display the order number + 1), the total order price, "This is what you requested to be put in your cup of coffee: ". Implement a selection structure to display the additives or black coffee as shown in the output example.

In Main:

Instantiate an array of 10 coffee order objects
set the x array index to zero and the counter that will track the number of orders taken up to 10 and the loop sentinel variable to Y
call the class method that will fill the CoffeeOrders array
a sentinel loop with a sentinel variable that will be initialized to character Y and a conditional that will continue while the sentinel is not equal to 'N' or 'n'
in the while loop while the sentinel is equal to Y, instantiate the coffee order object and assign it to the current coffee order array element
call the current array element objects' get data method, passing the counter that keeps track of the number of orders up to 10, by reference
update the counter, update the x array index
prompt the user to enter a y or Y for another cup of coffee (another coffee object) and when an n or N is entered terminate the loop.
check if the array of coffee objects index equals 10, set the sentinal value to N to exit the loop (you can only create and assign 10 coffee objects to the array of objects

Internal Documentation

The class will contain the following methods: getData and displaydata as specified above. You are creating an array to hold 10 coffee objects. Each time you take an order in Main you have to instantiate that object and assign it to the appropriate array element. Remember that you can only create 10 coffee objects. The counter you pass by reference from Main to the get data method is used by the class method to set the order number for the get data method. Analyze the suggested inputs and outputs to gain further information about how the processes are run and how incorrect inputs are handled.

Possible output might look like this:

You are ordering a fine cup of coffee. What would you like in your coffee?

1. Black

2. Cream & Sugar, add 25 cents

3. Cream & Artificial Sweetener, add 40 cents

4. Milk & Sugar, add 30 cents

5. Milk & Artificial Sweetener, add 40 cents

Please enter your selection from 1 to 5: 1

Do you want to order another cup of coffee? y

You are ordering a fine cup of coffee. What would you like in your coffee?

1. Black

2. Cream & Sugar, add 25 cents

3. Cream & Artificial Sweetener, add 40 cents

4. Milk & Sugar, add 30 cents

5. Milk & Artificial Sweetener, add 40 cents

Please enter your selection from 1 to 5: 3

Do you want to order another cup of coffee? Y

You are ordering a fine cup of coffee. What would you like in your coffee?

1. Black

2. Cream & Sugar, add 25 cents

3. Cream & Artificial Sweetener, add 40 cents

4. Milk & Sugar, add 30 cents

5. Milk & Artificial Sweetener, add 40 cents

Please enter your selection from 1 to 5: 8

You entered an incorrect selection, please try again.

You are ordering a fine cup of coffee. What would you like in your coffee?

1. Black

2. Cream & Sugar, add 25 cents

3. Cream & Artificial Sweetener, add 40 cents

4. Milk & Sugar, add 30 cents

5. Milk & Artificial Sweetener, add 40 cents

Please enter your selection from 1 to 5: 4

Do you want to order another cup of coffee? y

You are ordering a fine cup of coffee. What would you like in your coffee?

1. Black

2. Cream & Sugar, add 25 cents

3. Cream & Artificial Sweetener, add 40 cents

4. Milk & Sugar, add 30 cents

5. Milk & Artificial Sweetener, add 40 cents

Please enter your selection from 1 to 5: 5

Do you want to order another cup of coffee? N

Order Number: 1 Amount of Order: 1.95

This is what you requested to be put in your cup of coffee:

Black and nothing else

Order Number: 2 Amount of Order: 2.35

This is what you requested to be put in your cup of coffee:

Cream & Artificial Sweetener

Order Number: 3 Amount of Order: 2.25

This is what you requested to be put in your cup of coffee:

Milk & Sugar

Order Number: 4 Amount of Order: 2.35

This is what you requested to be put in your cup of coffee:

Milk & Artificial Sweetener)

Reference no: EM13775014

Questions Cloud

All sales are on account and are collected : Company has sales forecasts of the following: February = $40,000; March = $65,000. All sales are on account and are collected as follows: 20% in the current month, 50% in the month following, 25% in the second month following, and 5% uncollectible. I..
Sales forecasts-what are the cash receipts : Company has sales forecasts of the following: January = $40,000; February = $65,000; March = $52,850. All sales are on account and are collected as follows: 20% in the current month, 50% in the month following, 25% in the second month following, and ..
What operations and processes are we looking for : 1250 word and there is a data which I will send it to you to apply on the case studies And for the cases explain each of them and apply the data then chose one and focus on it just recommend one case of the three Find the
What is the APR of the loan : A person was considering buying a house priced at $300,000. A mortgage company claimed the interest rate for the 20 year loan is What would the monthly payment, if the person decided to borrow 90% of the cost of the house and 100% of the processing f..
Create a c# program that includes a coffeeorder class : Create a program that includes the following requirements: Create a CoffeeOrder class
What is desired inventory : Company projects the next period sales will be 12,000 units. Company desires ending inventory equal to 20% of next month's sales. What is desired inventory? Also, if the beginning inventory is 100, and the current months sales are 14,000, what is the..
Write essay about business law : Write essay (term paper) 6 pages about business law with 5 recourse any topic
How will these electives further career goals in general : What skills and knowledge do you expect to learn from these classes? How will these individual skills and knowledge help you in your field? How will these electives further your career goals in general
Prepare the journal entries for heidebrecht design : Heidebrecht Design acquired 20% of the outstanding common stock of Quayle Company on January 1, 2014, by paying $800,000 for the 30,000 shares. Quayle declared and paid $0.30 per share cash dividends on March 15, June 15, September 15, and December 1..

Reviews

Write a Review

DOT NET Programming Questions & Answers

  Describe the characteristics of visual studio 2005

Describe the characteristics of Visual Studio 2005 Visual Studio.Net is a suite of products that includes 4 main languages. Name these languages and outline their use in industries

  Each salesperson passes

Thus, each salesperson passes between 0 and 5 slips per day. Assume that the information from all of the slips from last month are available. Write an app that will read all the information for last months sales and summarize the total sales by sales..

  Asp.net and database web application

Database table definition is provided along with the marking craitria for better answer

  Implementing the insurance management system

Implementing the Insurance Management System and implementation of Components as Web Services.

  Part-1use one business rule delivery fees consist of a

part-1use one business rule delivery fees consist of a fixed amount of 1000 per truck plus carbon emission charge and

  Question 1a using the help of a diagram describe the layer

question 1a using the help of a diagram describe the layer of the .net framework that sits between visual basic.net

  Creates three arrays of type double

Write a C# program that creates three arrays of type double. Using a loop, prompt the user to input 10 initial values for each of two arrays (for a total of 20 values).

  Webiste hi sir cis2003 is the qustion sheet rubalall is

hi sir cis2003 is the qustion sheet rubal.all is the privious work for this

  How linear structures-particularly arrays-are implemented

Project at work calls for storage of computer maintenance schedule information. Using C# as source language, investigate how linear structures-particularly arrays-are implemented.

  Create a new class called clsbusiness layer

Create a new class called clsBusiness Layer. public static bool SendEmail string Sender, string Recipient, string bcc, string cc, string Subject, string Body

  Build a virtual think-a-dot in visual basic 2010

As originally constructed, a marble could be dropped into one of three holes in the top of the machine. It would then percolate through the machine and come out a hole on the bottom left or right.

  Create a new web form called frmuseractivity

Create a new Web form called frmUserActivity. Switch to Design Mode and add a Label and GridView (found under the Toolbox, Data tab) having the following properties:

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