- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.IO.Pipes;
- using System.Linq;
- using System.Runtime.Remoting.Metadata.W3cXsd2001;
- using System.Text;
- using System.Threading.Tasks;
- namespace Assignment3
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Welcome to Modern Appliances!");
- Console.WriteLine("How may we assist you?");
- Console.WriteLine("1- Check out Appliance", "\n2- Find Appliances by brand", "\n3- Display appliances by type", "\n4- Produce random appliance list", "\n 5- Save & exit");
- Console.WriteLine("Enter Option: ");
- string option = Console.ReadLine();
- int choice = int.Parse(option);
- while (choice == 1)
- {
- Console.WriteLine("Working");
- Console.WriteLine("Enter the Item number of an appliance: ");
- string AppId = Console.ReadLine();
- int choice2 = int.Parse(AppId);
- string[] lines = File.ReadAllLines("C:\\Users\\himal\\Desktop\\Assignment3\\Assignment3\\appliances.txt");
- string filepath = "C:\\Users\\himal\\Desktop\\Assignment3\\Assignment3\\appliances.txt";
- File.ReadAllLines(filepath);
- foreach (string line in lines)
- {
- string[] parts = line.Split(';');
- string id = parts[0];
- string name = parts[1];
- string value = parts[2];
- string colour = parts[3];
- }
- }
- }
- }
- }
[text] updated
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new:
File Description
- updated
- Paste Code
- 09 Feb-2023
- 1.73 Kb
You can Share it: