Question
Can you help me write some part of this in C# please thank you Data Formatting Each of the following appliance types is represented differently
Can you help me write some part of this in C# please thank you
Data Formatting
Each of the following appliance types is represented differently in the supplied appliances.txt file.
Each line in the file represents a different appliance and each piece of information for an appliance is separated by a semi-colon.
The first digit of the Item Number indicates the type of the appliance. Each item number is 9 digits long.
Refrigerators
The first digit of the Item Number for refrigerators is 1.
Refrigerators have an Item Number, Brand, Quantity, Wattage, Color, Price, Number of Doors, Height and Width (in inches).
The number of doors value can be either 2 (double doors), 3 (three doors) or 4 (four doors).
Each refrigerator is represented in the appliances.txt file file as follows:
ItemNumber;Brand;Quantity;Wattage;Color;Price;NumberOfDoors;Height;Width
Example:
089360200;Bosch;176;60;black;2000;2;62;29;
Vacuums
The first digit of the Item Number for vacuums is 2.
Vacuums have an Item Number, Brand, Quantity, Wattage, Color, Price, Grade and Battery Voltage.
The Battery voltage value can be either 18 V (Low) or 24 V (High).
Each vacuum is represented in the appliances.txt file as follows:
ItemNumber;Brand;Quantity;Wattage;Color;Price;Grade;BatteryVoltage
Example:
263788832;Hoover;59;600;black;750;Residential;18;
Microwaves
The first digit of the Item Number for microwaves is 3.
Microwaves have an Item Number, Brand, Quantity, Wattage, Color, Price, Capacity and Room Type.
The room type is where the microwave will be installed, and is either K (kitchen) or W (work site)
Each microwave is represented in the appliances.txt file as follows:
ItemNumber;Brand;Quantity;Wattage;Color;Price;Capacity;RoomType
Example:
383477937;Miele;201;2350;white;179.9;1.8;Kitchen;
Dishwashers
The first digit of the Item Number for dishwashers is 4 or 5.
Dishwashers have an Item Number, Brand, Quantity, Wattage, Color, Price, Sound Rating, and Feature.
The Sound Rating of the dishwasher can be Qt (Quietest), Qr (Quieter), Qu (Quiet) or M (Moderate).
Each dishwasher is represented in the appliances.txt file as follows:
ItemNumber;Brand;Quantity;Wattage;Color;Price;Feature;SoundRating
Example:
587065284;Kenwood;74;1010;silver;390;Clean with Steam;Quiet;
Program Guidelines
The fact that the data formatting is different for each type of appliance adds a level of complexity to program development. Creating a class hierarchy is required:
Determine the attributes that are shared between the appliance types and create an Appliance class containing them.
Note: The Appliance class cannot be instantiated and must be a super-class.
Create the following classes such that each one inherits the Appliance class and is located in the programs ProblemDomain folder:
Refrigerator
Vacuum
Microwave
Dishwasher
Ensure that each of these classes has a user-defined constructor that assigns the appropriate attributes.
Override the ToString() method in each one of these classes, so that the data is in a human readable form.
The attributes should be displayed using vertical headers.
Along with the functionality mentioned above, include the following methods in your program:
A method that parses the appliances.txt file into a single list.
The list must be able to contain all appliance types (refrigerator, vacuum, microwave, and dishwasher).
Use the first digit of the item number to determine what valid type of appliance needs to be created (see the Appliance Details section for more information).
A method that allows a customer to purchase an appliance.
The customer is prompted to enter the item number of an appliance. If the entered item number does not match, the program will inform the customer with an error message. If the item number matches, the program checks the appliances availability. If there is an appliance available, the available count will be decremented and the appliance information will be displayed. Otherwise, the customer will be informed the appliance is not available.
A method that prompts the customer to enter a brand. The program performs a case-insensitive search of appliances that have the same brand, and displays them.
A method that prompts a user to enter a number, and the program then displays that number of random appliances. The appliances can be of any type.
When the program exits, implement and call a method that takes the appliances stored in the list and persists them back to the appliances.txt file in the proper format.
Welcome to Modern Appliances!
How may we assist you?
1 Check out appliance
2 Find appliances by brand
3 Display appliances by type
4 Produce random appliance list
5 Save & exit
Enter option:
1
Enter the item number of an appliance:
255131796
Appliance "255131796" has been checked out.
Welcome to Modern Appliances!
How May We Assist You?
1 Check out appliance
2 Find appliances by brand
3 Display appliances by type
4 Produce random appliance list
5 Save & exit
Enter option:
1
Enter item number of an Appliance:
143826003
The appliance is not available to be checked out.
Welcome to Modern Appliances!
How May We Assist You?
1 Check out appliance
2 Find appliances by brand
3 Display appliances by type
4 Produce random appliance list
5 Save & exit
Enter option:
1
Enter item number of an Appliance:
1234567895
No appliances found with that item number.
Welcome to Modern Appliances!
How May We Assist You?
1 Check out appliance
2 Find appliances by brand
3 Display appliances by type
4 Produce random appliance list
5 Save & exit
Enter option:
2
Enter brand to search for:
Tefal
Matching Appliances:
ItemNumber: 535981394
Brand: Tefal
Quantity: 90
Wattage: 700
Color: bronze
Price: 320
Feature: Third Rack
SoundRating: Quietest
ItemNumber: 243074424
Brand: Tefal
Quantity: 61
Wattage: 4000
Color: black
Price: 760
Grade: Residential
BatteryVoltage: Low
Welcome to Modern Appliances!
How May We Assist You?
1 Check out appliance
2 Find appliances by brand
3 Display appliances by type
4 Produce random appliance list
5 Save & exit
Enter option:
3
Appliance Types
1 Refrigerators
2 Vacuums
3 Microwaves
4 Dishwashers
Enter type of appliance:
1
Enter number of doors: 2 (double door), 3 (three doors) or 4 (four doors):
3
Matching refrigerators:
Item Number: 146947171
Brand: Black & Decker
Quantity: 112
Wattage: 1800
Color: grey
Price: 1800
Number of Doors: Three Doors
Height: 70
Width: 31
Item Number: 172911121
Brand: Philips
Quantity: 144
Wattage: 700
Color: black
Price: 3100
Number of Doors: Three Doors
Height: 71
Width: 30
Welcome to Modern Appliances!
How May We Assist You?
1 Check out appliance
2 Find appliances by brand
3 Display appliances by type
4 Produce random appliance list
5 Save & exit
Enter option:
3
Appliance Types
1 Refrigerators
2 Vacuums
3 Microwaves
4 Dishwashers
Enter type of appliance:
2
Enter battery voltage value. 18 V (low) or 24 V (high)
18
Matching vacuums:
Item Number: 255131796
Brand: Black & Decker
Quantity: 54
Wattage: 1500
Color: white
Price: 500
Grade: Residential
Battery voltage: Low
Item Number: 263788832
Brand: Hoover
Quantity: 59
Wattage: 600
Color: black
Price: 750
Grade: Residential
Battery voltage: Low
Item Number: 231784690
Brand: Russell Hobbs
Quantity: 155
Wattage: 175
Color: grey
Price: 380
Grade: Residential
Battery voltage: Low
ItemNumber: 243074424
Brand: Tefal
Quantity: 61
Wattage: 4000
Color: black
Price: 760
Grade: Residential
Battery voltage: Low
Item Number: 240201796
Brand: Dyson
Quantity: 81
Wattage: 1050
Color: white
Price: 290
Grade: Residential
Battery voltage: Low
Welcome to Modern Appliances!
How May We Assist You?
1 Check out appliance
2 Find appliances by brand
3 Display appliances by type
4 Produce random appliance list
5 Save & exit
Enter option:
3
Appliance Types
1 Refrigerators
2 Vacuums
3 Microwaves
4 Dishwashers
Enter type of appliance:
3
Room where the microwave will be installed: K (kitchen) or W (work site):
W
Matching microwaves:
Item Number: 328237584
Brand: Miele
Quantity: 90
Wattage: 1200
Color: bronze
Price: 250.23
Capacity: 2.1
Room Type: Work Site
Item Number: 333607621
Brand: Vax
Quantity: 113
Wattage: 440
Color: silver
Price: 123.99
Capacity: 1.6
Room Type: Work Site
Welcome to Modern Appliances!
How May We Assist You?
1 Check out appliance
2 Find appliances by brand
3 Display appliances by type
4 Produce random appliance list
5 Save & exit
Enter option:
3
Appliance Types
1 Refrigerators
2 Vacuums
3 Microwaves
4 Dishwashers
Enter type of appliance:
4
Enter the sound rating of the dishwasher: Qt (Quietest), Qr (Quieter), Qu(Quiet) or M (Moderate):
M
Matching dishwashers:
Item Number: 571522655
Brand: Philips
Quantity: 228
Wattage: 440
Color: grey
Price: 390
Feature: Finger Print Resistant
SoundRating: Moderate
ItemNumber: 493374445
Brand: Philips
Quantity: 125
Wattage: 1650
Color: silver
Price: 510
Feature: Clean with Steam
SoundRating: Moderate
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started