C# Programming Please see the attached photo for the instructions Complete this code:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

C# Programming

Please see the attached photo for the instructions

Complete this code:

 

*
Smoothie constructor should accept a list of ingredients.
Should not be empty => throw ArgumentException error
Ingredients should not be repeated => throw ArgumentException error
Ingredients that doesn't exist (ingredients are CASE SENSITIVE) => throw ArgumentException error
o Ingredients should not be null => throw ArgumentNullException error
Implement Ingredients Property
O will return a list of all supplied ingredients in the constructor
Ingredients should be in alphabetical order A->Z
0 Users should NOT be able to set Ingredients explicitly
smoothie. Ingredients = new List<string> {"Bananana"}; X
* Implement Name Property gets the ingredients and puts them in alphabetical order into a nice descriptive
sentence.
If there are multiple ingredients, add the word "Fusion" to the end but otherwise, add "Smoothie".
Remember to change "-berries" to "-berry". See the examples below.
Users should NOT be able to set Name explicitly
smoothie.Name = "IllegalName"; X
Implement GetCost method which calculates the total cost of the ingredients used to make the smoothie.
Round to two decimal places.
Implement GetPrice method which returns the number from Getcost plus the number from Getcost
multiplied by 1.5.
Round to two decimal places.
0
Ⓒ Round to two decimal places.
• Implement GetPrice method which returns the number from Getcost plus the number from GetCost
multiplied by 1.5.
Round to two decimal places.
Ingredient Price
Strawberries $1.50
Banana $0.50
Mango $2.50
Blueberries $1.00
Raspberries $1.00
Apple
Pineapple
$1.75
$3.50
Sample
Single Ingredient
s1 = new Smoothie (new List<string> { "Banana" });
s1. Ingredients - {"Banana" }
s1.Name + "Banana Smoothie"
s1.GetCost () "$0.50"
s1.GetPrice() - "$1.25"
Multiple Ingredients
s2 = new Smoothie (new List<string> { "Raspberries", "strawberries", "Blueberries" });
s2. Ingredients → { "Blueberries", "Raspberries", "Strawberries" }
$2.Name "Blueberry Raspberry strawberry Fusion"
$2.GetCost() ➡ "$3.50"
$2.GetPrice() - "$8.75"
Transcribed Image Text:* Smoothie constructor should accept a list of ingredients. Should not be empty => throw ArgumentException error Ingredients should not be repeated => throw ArgumentException error Ingredients that doesn't exist (ingredients are CASE SENSITIVE) => throw ArgumentException error o Ingredients should not be null => throw ArgumentNullException error Implement Ingredients Property O will return a list of all supplied ingredients in the constructor Ingredients should be in alphabetical order A->Z 0 Users should NOT be able to set Ingredients explicitly smoothie. Ingredients = new List<string> {"Bananana"}; X * Implement Name Property gets the ingredients and puts them in alphabetical order into a nice descriptive sentence. If there are multiple ingredients, add the word "Fusion" to the end but otherwise, add "Smoothie". Remember to change "-berries" to "-berry". See the examples below. Users should NOT be able to set Name explicitly smoothie.Name = "IllegalName"; X Implement GetCost method which calculates the total cost of the ingredients used to make the smoothie. Round to two decimal places. Implement GetPrice method which returns the number from Getcost plus the number from Getcost multiplied by 1.5. Round to two decimal places. 0 Ⓒ Round to two decimal places. • Implement GetPrice method which returns the number from Getcost plus the number from GetCost multiplied by 1.5. Round to two decimal places. Ingredient Price Strawberries $1.50 Banana $0.50 Mango $2.50 Blueberries $1.00 Raspberries $1.00 Apple Pineapple $1.75 $3.50 Sample Single Ingredient s1 = new Smoothie (new List<string> { "Banana" }); s1. Ingredients - {"Banana" } s1.Name + "Banana Smoothie" s1.GetCost () "$0.50" s1.GetPrice() - "$1.25" Multiple Ingredients s2 = new Smoothie (new List<string> { "Raspberries", "strawberries", "Blueberries" }); s2. Ingredients → { "Blueberries", "Raspberries", "Strawberries" } $2.Name "Blueberry Raspberry strawberry Fusion" $2.GetCost() ➡ "$3.50" $2.GetPrice() - "$8.75"
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY