Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSI 124 programming III, how to display using the following data from the given document but all are not used for the given table and

CSI 124 programming III, how to display using the following data from the given document but all are not used for the given table and using wpf window.
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Coffee-Italiano-$1.50-Points100-Venti-DarkTea-Matcha$$2.50-Points200-Short-Green Breakfast - Hash Browns - $3.00 - Points 300 - is Heated True - Has Dairy, False Lunch - Grilled Cheese - $5.50. Points 600 - is Heated True - is A Combo: True Tumbler - Emerald - $20.00 - Points 2500 - Color. Forest Green Mug - Seattle Mug - $15.00 - Points 1800 - Style Seattle Waterfront GiftCard - Gift Card - $50000 - Points 500 - Amount: $50000 Top : 3 List Boxes and labels to take Product information. The name, price, and points related to a single product. Below are the buttons and fields needed to create individual instances of objects. I've used 4 separate canvases to organize the information, you can organize how you like. Box 1 - Drinks: We have a combo box that lets users choose from 1 of 5 sizes. I provide the code to populate the comb box and even cast the selected value into a size. THIS IS RELATED TO THE ENUM IN YOUR DRINK CLASS Change the code as needed to make it work. Inside of your "Add Drink" button event Coffee. Size size =( Coffee.Size)cbSize.Selectedindex; The method below should load on opening of AddNewProduct Window: void PopulateSizeComboBox() \{ cbSize.Items.Add("Short"); cbSize.Items.Add("Tall"); cbSize.Items.Add("Grande"); cbSize.Items.Add("Venti"); cbSize.Items.Add("Trenta"); cbSize.Selectedindex 0 ; If it works, your combo box should be filled with name and have display Short on load. Change the combo box name to match yours. Box 2 - Food: Box 2 uses 2 checkboxes, ( again, you can add more, I repurposed a check box ). One box is for passing in a bool to see if the food is hot. The other is to pass in a bool depending on if a Breakfast has dairy in it, or a lunch is a combo. To retrieve the bool value from a check box in wpf you need to How to get the "if checked" result from a check box Bool isChecked = ckBoxName.IsChecked. Value; Make sure to add the. Value to the end, otherwise it'll yell at you. Box 2-Food: Box 2 uses 2 checkboxes, ( again, you can add more, I repurposed a check box ). One box is for passing in a bool to see if the food is hot. The other is to pass in a bool depending on if a Breakfast has dairy in it, or a lunch is a combo. To retrieve the bool value from a check box in wpf you need to How to get the "if checked" result from a check box Bool isChecked = ckBoxName.IsChecked.Value: Make sure to add the. Value to the end, otherwise it'll yell at you. Box 3 - Merchandise: This has a textbox to pass in a string. Box 4 - Gift Card Clicking this should generate a gift card that is the same amount as the price entered above. Classes To Create: - Data Class ( This will be used so our 3 separate windows can access the same data collections. - Product ( Abstract) Drink ( Abstract: Base Product) - Coffee (Base Drink) - Tea (Base Drink) Food (Abstract: Base Product) - Breakfast (Base Food) - Lunch (Base Food) Merchandise (Abstract: Base Product) - Tumblers (Base Merchandise) - Mugs (Base Merchandise) GiftCard (Base Product) - Member (Abstract) GoldMember (Base Member) RegularMember (Base Member) STATIC Fields - Observable Collection for Member - Oberserable Collection for Products - currentProduct = null - current Member = null STATIC Constructor - Initialize both observable collections here STATIC Property ( All sets done by methods) - Public MemberCollection \{get; \} - Public ProductCollect \{get; } - Public CurrentProduct \{get; } - Public CurrentMember \{get; } STATIC Methods - Public Void AddProductToCollection(Product) - Public Void AddMemberToCollection(Member) - Public Void UpdateCurrentProduct(Product) - Public Void UpdateCurrentMember(Member) Your data class is vital to your project. All listboxes or combo boxes that need to display products o members should be connected to the collections here. MAKE SURE TO USE selectionBox.ItemsSou CollectionName to make your life easier. All Properties should be static, and only have getters. Adding anything to your fields should be don with methods. - Name - Sku ( a random number between 1000000 and 10000000) - Price - Points - Number of Product (static) Constructor Product (Name, price, points) \{ Wire up code to fields Use a random object to assign a value to sku between 1000000 and 10000000 Number of Product ++ in here 3 Override ToString - Display GetType(), Sku, Name, Price, and point amount. Product (abstract ) - Name - Sku ( a random number between 1000000 and 10000000 ) - Price - Points - Number of Product ( static) Constructor Product ( Name, price, points) Wire up code to fields Use a random object to assign a value to sku between 1000000 and 10000000 Number of Product + in here \} Override ToString - Display GetType(), Sku, Name, Price, and point amount. Drinks, (abstract, child of Product) Enumerable for size (Short, Tall, Grade, Venti, Trenta) Size drink size Constructor also made to take Size Coffee (child of Drink) - Field - Type of Roast ( string ) - Constructor - Take type of roast - Override ToString - Append Roast to base Tea (child of Drink) - Field - Type of tea (green, white, black, etc...) - Constructor - Take type of roast - Override ToString Append tea to base Food ( abstract, child of Product) bool isHeated Food ( abstract, child of Product) bool isHeated - Constructor to take Heated Breakfast (child of Food) - Field - Bool hasDairy - Constructor - Take if it hasDairy - Override ToString - Append hasDairy to base Lunch - Field - Bool isCombo - Constructor - Take if it is a Combo - Override ToString Append isCombo to base Merchandise, ( abstract, child of Product) Tumblers ( child of Merchandise ) Field - String Color Constructor - Take the color Override ToString - Append Color to base Gift Cards (child of Product) - Field - Amount - Constructor to take amount - Override ToString Append amount to base ALL CLASSES SHOULD OVERRIDE THE TO STRING - Each class should add it's unique field to the end of the parents to string Class: Member ( abstract ) - First Name - Last Name - Member number ( a random number between 1000000 and 10000000) - Point Amount - Member Since ( DateTime object) - Previous Transactions ( Observable Collection - Product) Constructor - Member (Firstname, lastname) Member number randomly generate Point amount starts at 0 Member since should use DateTime. Now Initialize Previous Transactions Collection Property previousTransaction \{ get; } Method DeductPoints(Product) : Abstract AddPoints(Product) : Abstract Public AddProduct(Product) : Add product to previousTransactions Collection Override ToString - GetType() - First Name Last Name - Points (Display Points ) - Member Number - Regular Member ( Child of Member) Override DeductPoints(Product) Deduct the products points from the member Override AddPoints(Product) : Abstract Add the products points for the member Gold Member ( Child of Member) Override DeductPoints(Product) Deduct HALF the products points - 50 from the member Override AddPoints(Product) : Abstract Add the products points +50 for the member Coffee-Italiano-$1.50-Points100-Venti-DarkTea-Matcha$$2.50-Points200-Short-Green Breakfast - Hash Browns - $3.00 - Points 300 - is Heated True - Has Dairy, False Lunch - Grilled Cheese - $5.50. Points 600 - is Heated True - is A Combo: True Tumbler - Emerald - $20.00 - Points 2500 - Color. Forest Green Mug - Seattle Mug - $15.00 - Points 1800 - Style Seattle Waterfront GiftCard - Gift Card - $50000 - Points 500 - Amount: $50000 Top : 3 List Boxes and labels to take Product information. The name, price, and points related to a single product. Below are the buttons and fields needed to create individual instances of objects. I've used 4 separate canvases to organize the information, you can organize how you like. Box 1 - Drinks: We have a combo box that lets users choose from 1 of 5 sizes. I provide the code to populate the comb box and even cast the selected value into a size. THIS IS RELATED TO THE ENUM IN YOUR DRINK CLASS Change the code as needed to make it work. Inside of your "Add Drink" button event Coffee. Size size =( Coffee.Size)cbSize.Selectedindex; The method below should load on opening of AddNewProduct Window: void PopulateSizeComboBox() \{ cbSize.Items.Add("Short"); cbSize.Items.Add("Tall"); cbSize.Items.Add("Grande"); cbSize.Items.Add("Venti"); cbSize.Items.Add("Trenta"); cbSize.Selectedindex 0 ; If it works, your combo box should be filled with name and have display Short on load. Change the combo box name to match yours. Box 2 - Food: Box 2 uses 2 checkboxes, ( again, you can add more, I repurposed a check box ). One box is for passing in a bool to see if the food is hot. The other is to pass in a bool depending on if a Breakfast has dairy in it, or a lunch is a combo. To retrieve the bool value from a check box in wpf you need to How to get the "if checked" result from a check box Bool isChecked = ckBoxName.IsChecked. Value; Make sure to add the. Value to the end, otherwise it'll yell at you. Box 2-Food: Box 2 uses 2 checkboxes, ( again, you can add more, I repurposed a check box ). One box is for passing in a bool to see if the food is hot. The other is to pass in a bool depending on if a Breakfast has dairy in it, or a lunch is a combo. To retrieve the bool value from a check box in wpf you need to How to get the "if checked" result from a check box Bool isChecked = ckBoxName.IsChecked.Value: Make sure to add the. Value to the end, otherwise it'll yell at you. Box 3 - Merchandise: This has a textbox to pass in a string. Box 4 - Gift Card Clicking this should generate a gift card that is the same amount as the price entered above. Classes To Create: - Data Class ( This will be used so our 3 separate windows can access the same data collections. - Product ( Abstract) Drink ( Abstract: Base Product) - Coffee (Base Drink) - Tea (Base Drink) Food (Abstract: Base Product) - Breakfast (Base Food) - Lunch (Base Food) Merchandise (Abstract: Base Product) - Tumblers (Base Merchandise) - Mugs (Base Merchandise) GiftCard (Base Product) - Member (Abstract) GoldMember (Base Member) RegularMember (Base Member) STATIC Fields - Observable Collection for Member - Oberserable Collection for Products - currentProduct = null - current Member = null STATIC Constructor - Initialize both observable collections here STATIC Property ( All sets done by methods) - Public MemberCollection \{get; \} - Public ProductCollect \{get; } - Public CurrentProduct \{get; } - Public CurrentMember \{get; } STATIC Methods - Public Void AddProductToCollection(Product) - Public Void AddMemberToCollection(Member) - Public Void UpdateCurrentProduct(Product) - Public Void UpdateCurrentMember(Member) Your data class is vital to your project. All listboxes or combo boxes that need to display products o members should be connected to the collections here. MAKE SURE TO USE selectionBox.ItemsSou CollectionName to make your life easier. All Properties should be static, and only have getters. Adding anything to your fields should be don with methods. - Name - Sku ( a random number between 1000000 and 10000000) - Price - Points - Number of Product (static) Constructor Product (Name, price, points) \{ Wire up code to fields Use a random object to assign a value to sku between 1000000 and 10000000 Number of Product ++ in here 3 Override ToString - Display GetType(), Sku, Name, Price, and point amount. Product (abstract ) - Name - Sku ( a random number between 1000000 and 10000000 ) - Price - Points - Number of Product ( static) Constructor Product ( Name, price, points) Wire up code to fields Use a random object to assign a value to sku between 1000000 and 10000000 Number of Product + in here \} Override ToString - Display GetType(), Sku, Name, Price, and point amount. Drinks, (abstract, child of Product) Enumerable for size (Short, Tall, Grade, Venti, Trenta) Size drink size Constructor also made to take Size Coffee (child of Drink) - Field - Type of Roast ( string ) - Constructor - Take type of roast - Override ToString - Append Roast to base Tea (child of Drink) - Field - Type of tea (green, white, black, etc...) - Constructor - Take type of roast - Override ToString Append tea to base Food ( abstract, child of Product) bool isHeated Food ( abstract, child of Product) bool isHeated - Constructor to take Heated Breakfast (child of Food) - Field - Bool hasDairy - Constructor - Take if it hasDairy - Override ToString - Append hasDairy to base Lunch - Field - Bool isCombo - Constructor - Take if it is a Combo - Override ToString Append isCombo to base Merchandise, ( abstract, child of Product) Tumblers ( child of Merchandise ) Field - String Color Constructor - Take the color Override ToString - Append Color to base Gift Cards (child of Product) - Field - Amount - Constructor to take amount - Override ToString Append amount to base ALL CLASSES SHOULD OVERRIDE THE TO STRING - Each class should add it's unique field to the end of the parents to string Class: Member ( abstract ) - First Name - Last Name - Member number ( a random number between 1000000 and 10000000) - Point Amount - Member Since ( DateTime object) - Previous Transactions ( Observable Collection - Product) Constructor - Member (Firstname, lastname) Member number randomly generate Point amount starts at 0 Member since should use DateTime. Now Initialize Previous Transactions Collection Property previousTransaction \{ get; } Method DeductPoints(Product) : Abstract AddPoints(Product) : Abstract Public AddProduct(Product) : Add product to previousTransactions Collection Override ToString - GetType() - First Name Last Name - Points (Display Points ) - Member Number - Regular Member ( Child of Member) Override DeductPoints(Product) Deduct the products points from the member Override AddPoints(Product) : Abstract Add the products points for the member Gold Member ( Child of Member) Override DeductPoints(Product) Deduct HALF the products points - 50 from the member Override AddPoints(Product) : Abstract Add the products points +50 for the member

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Theory And Applications 27th Australasian Database Conference Adc 20 Sydney Nsw September 28 29 20 Proceedings Lncs 9877

Authors: Muhammad Aamir Cheema ,Wenjie Zhang ,Lijun Chang

1st Edition

3319469215, 978-3319469218

More Books

Students also viewed these Databases questions

Question

Draft a proposal for a risk assessment exercise.

Answered: 1 week ago