Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Linq;
- using System.Collections.Generic;
- namespace CSharp_Shell
- {
- public class Program
- {
- public static void Main(string[] args)
- {
- string[,] book = new string[50,6]
- {
- //this will serves as the database of the program
- {"Programming", "Dr. Ronjie Malinao", "2013", "Marinduque, Philippines", "200", "https://programming101.com/programming"},
- {"Philosophy", "Arnel Perlada", "2000", "Scotland", "300", "https://scholar.com/philosophy"},
- {"Literatura", "Felix David", "2021", "Philippines", "580", "https://oro.open.uk/literatura"},
- {"Logic", "James Borly", "2012", "Alaska", "500", "https://mathecho.com/logic"},
- {"Arithmetic", "Hayde Atyde", "2009", "America", "215", "https://www.america.edu/animal-kingdom"},
- {"Architecture", "Alen Decena", "2011", "North America", "450", "https://www.worldmaker.com/architecture"},
- {"Earth", "James Brooklyn", "2019", "Texas", "30", "https://www.humane.org/earth"},
- {"Technologies", "Reymond Aspol", "2012", "New York", "160", "https://newyorktimes.com/technologies"},
- {"Innovation", "Andie Reyn", "2021", "America","500", "https://www.techy.edu/innovation"},
- {"Government", "Roxy Ada", "2018", "Manila Philippines", "90", "https://asiangovernment.com/governments"},
- {"Corruption", "Alejandro Borly", "2013", "New York", "60", "https://asiangovernment.com/corruption"},
- {"Agriculture", "Lea Axel", "2020", "Saudi Arabia", "230", "https://globetree.com/agriculture"},
- {"Tech and Science", "Alea de Guzman", "2019", "Rome, Italy", "630", "https://romanlibrary.com/tech-and-science"},
- {"Business World", "Loyd Arnel", "2019", "Emirates", "450","https://entrepreneurhip.com/business-world"},
- {"Entrepreneur", "Arlin Matre", "2015","Singapore", "300", "https://entrepreneurship.com/entrepreneur"},
- {"Heroes", "Agatha Felix", "2021", "Finlad", "450", "https://www.googlescholar.com/heroes"},
- {"Children's Dream", "Jhonny Edmond", "2014", "South America","100", "https://librarian.org/dream-world"},
- {"Adventure", "Roy Lexi", "2017", "California", "280", "https://compass.com/traveller"},
- {"Dessert", "James Borly", "2018", "Saudi Arabia", "340", "https://www.sandland.edu/dessert"},
- {"Artificial Intelligence", "Jj Borly", "2020", "Philippines","120", "https://www.sciencetech.com/artificial-intelligence"},
- {"Mathematics", "Lesby Agre", "2019", "Tokyo, Japan", "480", "https://matheweb.com/mathematics"},
- {"Physical Education", "James Lloyd", "2019", "Philippines", "250","https://educado.com/physical-education"},
- {"Languages", "James Lloyd", "2021", "America", "210", "https://worldsound.com/languages"},
- {"Disaster", "Lyshane Lebron", "2020", "U.S.A", "500", "https://redcross.org/disaster"},
- {"Galaxy", "Erix Layn", "2012", "Texas", "360", "https://outsideworld.com/galaxy"},
- {"Math", "James Lloyd", "2021", "America", "230", "https://matheasy.com/math"},
- {"Animation", "James Agorn", "2020", "Boston", "800", "https://www.anime.com/animation"},
- {"History", "James Arbel", "2018","Philippines", "680","https://historyan.com/history-ph"},
- {"Rizal", "Angel Archei", "2018", "Philippines", "1110", "https://www.nationalhero.com/rizal"},
- {"Physical Health", "Rasta Man", "2019", "England", "320", "https://worldhealth.org/physical-health"},
- {"Sports", "Ryle Endi", "2019","London", "800", "https://worldfitness.com/sports"},
- {"Trend", "Ariel Lloyd", "2021", "North America", "790", "https://www.whatsup.com/trend"},
- {"Disney", " Arch Losid", "2019", "Singapore", "860","https://www.worldfantasy.com/disney"},
- {"Grammar", "Yna Leya", "2019", "Texas, California", "950", "https://englibrary.com/grammar"},
- {"English", "Ryle Gurl", "2020", "U.S.A", "840","https://englibrary.com/english"},
- {"Values", "Mio Takashi", "2020", "Kyoto, Japan", "1500", "https://www.morale.com/values"},
- {"Generations", "Ariex Lloyd", "2021", "Rome, Italy", "1200", "https://www.humane.com/generations"},
- {"Revolutions", "Rowane Rose", "2016", "Madrid, Spain", "450", "https://www.historian.com/revolutions"},
- {"Online Games", "Hackeiro Randi", "2021", "Manila, Philippines", "620", "https://www.esports.com/online-games"},
- {"Art", "Jeany d Arch", "2019", "Singapore", "1000", "https://www.artist.com/art"},
- {"Photography", "Raniel Riedcliff", "2020", "Paris, France", "895", "https://anglecam.org/photography"},
- {"Culture", "Real Lidad", "2016", "Texas, California", "990","https://www.humane.com/culture"},
- {"Chemistry", "Roxue Rudues", "2015", "Boston, America", "650", "https://sciarchive.com/chemistry"},
- {"Biology", "Justine Earl Abdul", "2015", "Boston, America", "500", "https://www.sciarchive.com/biology"},
- {"Botany", "Aspel Jacobe", "2017", "Texas, California", "620", "https://www.sciarchive.com/botany"},
- {"Ethnics", "Royde Rex","2019", "Indonesia", "480", "https://www.humannature.com/ethnics"},
- {"Tradition and Culture", "Ashlie Reymart", "2019", "Manila, Philippines", "790", "https://likas.org/tradition-and-culture"},
- {"Multimedia", "Roylyn Axel", "2018", "Hongkong", "290", "https://anglecam.com/multimedia"},
- {"Religions", "Fr. Jacobe Arlenda", "2020", "Rome, Italy", "1500","https://www.humane.com/religions"},
- {"Computers", "Ron Wesley", "2021", "New Yor City", "500", "https://modernworld.com/computers"}
- };
- //welcoming the user
- Console.WriteLine("---------------------------------");
- Console.WriteLine(" REFERENCE BOOK");
- Console.WriteLine(" Created by Jet Francis Podaca");
- Console.WriteLine("---------------------------------\n");
- string userName;
- Console.Write("Please Enter your Name: ");
- userName=Console.ReadLine();
- Console.WriteLine();
- Console.WriteLine(" Hello " + userName + ", welcome to Reference Book. I am happy to give you a hand.");
- Console.WriteLine();
- //in order to have a loop
- while(true)
- {
- Console.WriteLine();
- Console.WriteLine("Please input the tittle of a Book you want.");
- Console.Write("Book Tittle: ");
- string booknamesearch = Console.ReadLine();
- Console.WriteLine();
- string f = "Not Found";
- //f stands for found
- for (int i=0;i<book.GetLength(0);i++)
- {
- if (booknamesearch == book[i, 0])
- {
- Console.WriteLine("Found it!");
- Console.WriteLine("_________________________________\n");
- Console.WriteLine("Book Tittle: " + book[i, 0]);
- Console.WriteLine("Author: " + book[i, 1]);
- Console.WriteLine("Year Published: " + book[i, 2]);
- Console.WriteLine("Place of Publication: " + book[i, 3]);
- Console.WriteLine("Number of Pages: " + book[i, 4] + " pages");
- Console.WriteLine("\nYou can view or dowload it for free at: " + book[i, 5]);
- Console.WriteLine("_________________________________");
- f = "Found";
- }
- }
- if (f!="Found")
- {
- Console.WriteLine(" Searched Book Not Found!");
- }
- //ask the user to continue or to exit
- string answer;
- Console.WriteLine();
- Console.Write("Search again? (Yes | No): ");
- answer=Console.ReadLine();
- if (answer != "Yes" || answer != "yes")
- {
- string answer_2;
- Console.WriteLine();
- Console.Write("Want to Exit? (Yes | No): ");
- answer_2=Console.ReadLine();
- if (answer_2 == "Yes" || answer_2 == "yes")
- {
- Environment.Exit(0);
- //directly exiting the program
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement