Advertisement
Jet_Francis_Podaca

REFERENCE BOOK-FINAL (C# Shell App Paste)

Dec 14th, 2021
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 8.13 KB | None | 0 0
  1. //Disclaimer: The creator of 'C# Shell (C# Offline Compiler)' is in no way responsible for the code posted by any user.
  2. using System;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Collections.Generic;
  6.  
  7. namespace CSharp_Shell
  8. {
  9.  
  10.     public class Program
  11.     {
  12.         public static void Main(string[] args)
  13.         {
  14.             string[,] book = new string[50,6]
  15.             {
  16.                 //this will serves as the database of the program
  17.                 {"Programming", "Dr. Ronjie Malinao", "2013", "Marinduque, Philippines", "200", "https://programming101.com/programming"},
  18.                 {"Philosophy", "Arnel Perlada", "2000", "Scotland", "300", "https://scholar.com/philosophy"},
  19.                 {"Literatura", "Felix David", "2021", "Philippines", "580", "https://oro.open.uk/literatura"},
  20.                 {"Logic", "James Borly", "2012", "Alaska", "500", "https://mathecho.com/logic"},
  21.                 {"Arithmetic", "Hayde Atyde", "2009", "America", "215", "https://www.america.edu/animal-kingdom"},
  22.                 {"Architecture", "Alen Decena", "2011", "North America", "450", "https://www.worldmaker.com/architecture"},
  23.                 {"Earth", "James Brooklyn", "2019", "Texas", "30", "https://www.humane.org/earth"},
  24.                 {"Technologies", "Reymond Aspol", "2012", "New York", "160", "https://newyorktimes.com/technologies"},
  25.                 {"Innovation", "Andie Reyn", "2021", "America","500", "https://www.techy.edu/innovation"},
  26.                 {"Government", "Roxy Ada", "2018", "Manila Philippines", "90", "https://asiangovernment.com/governments"},
  27.                 {"Corruption", "Alejandro Borly", "2013", "New York", "60", "https://asiangovernment.com/corruption"},
  28.                 {"Agriculture", "Lea Axel", "2020", "Saudi Arabia", "230", "https://globetree.com/agriculture"},
  29.                 {"Tech and Science", "Alea de Guzman", "2019", "Rome, Italy", "630", "https://romanlibrary.com/tech-and-science"},
  30.                 {"Business World", "Loyd Arnel", "2019", "Emirates", "450","https://entrepreneurhip.com/business-world"},
  31.                 {"Entrepreneur", "Arlin Matre", "2015","Singapore", "300", "https://entrepreneurship.com/entrepreneur"},
  32.                 {"Heroes", "Agatha Felix", "2021", "Finlad", "450", "https://www.googlescholar.com/heroes"},
  33.                 {"Children's Dream", "Jhonny Edmond", "2014", "South America","100", "https://librarian.org/dream-world"},
  34.                 {"Adventure", "Roy Lexi", "2017", "California", "280", "https://compass.com/traveller"},
  35.                 {"Dessert", "James Borly", "2018", "Saudi Arabia", "340", "https://www.sandland.edu/dessert"},
  36.                 {"Artificial Intelligence", "Jj Borly", "2020", "Philippines","120", "https://www.sciencetech.com/artificial-intelligence"},
  37.                 {"Mathematics", "Lesby Agre", "2019", "Tokyo, Japan", "480", "https://matheweb.com/mathematics"},
  38.                 {"Physical Education", "James Lloyd", "2019", "Philippines", "250","https://educado.com/physical-education"},
  39.                 {"Languages", "James Lloyd", "2021", "America", "210", "https://worldsound.com/languages"},
  40.                 {"Disaster", "Lyshane Lebron", "2020", "U.S.A", "500", "https://redcross.org/disaster"},
  41.                 {"Galaxy", "Erix Layn", "2012", "Texas", "360", "https://outsideworld.com/galaxy"},
  42.                 {"Math", "James Lloyd", "2021", "America", "230", "https://matheasy.com/math"},
  43.                 {"Animation", "James Agorn", "2020", "Boston", "800", "https://www.anime.com/animation"},
  44.                 {"History", "James Arbel", "2018","Philippines", "680","https://historyan.com/history-ph"},
  45.                 {"Rizal", "Angel Archei", "2018", "Philippines", "1110", "https://www.nationalhero.com/rizal"},
  46.                 {"Physical Health", "Rasta Man", "2019", "England", "320", "https://worldhealth.org/physical-health"},
  47.                 {"Sports", "Ryle Endi", "2019","London", "800", "https://worldfitness.com/sports"},
  48.                 {"Trend", "Ariel Lloyd", "2021", "North America", "790", "https://www.whatsup.com/trend"},
  49.                 {"Disney", " Arch Losid", "2019", "Singapore", "860","https://www.worldfantasy.com/disney"},
  50.                 {"Grammar", "Yna Leya", "2019", "Texas, California", "950", "https://englibrary.com/grammar"},
  51.                 {"English", "Ryle Gurl", "2020", "U.S.A", "840","https://englibrary.com/english"},
  52.                 {"Values", "Mio Takashi", "2020", "Kyoto, Japan", "1500", "https://www.morale.com/values"},
  53.                 {"Generations", "Ariex Lloyd", "2021", "Rome, Italy", "1200", "https://www.humane.com/generations"},
  54.                 {"Revolutions", "Rowane Rose", "2016", "Madrid, Spain", "450", "https://www.historian.com/revolutions"},
  55.                 {"Online Games", "Hackeiro Randi", "2021", "Manila, Philippines", "620", "https://www.esports.com/online-games"},
  56.                 {"Art", "Jeany d Arch", "2019", "Singapore", "1000", "https://www.artist.com/art"},
  57.                 {"Photography", "Raniel Riedcliff", "2020", "Paris, France", "895", "https://anglecam.org/photography"},
  58.                 {"Culture", "Real Lidad", "2016", "Texas, California", "990","https://www.humane.com/culture"},
  59.                 {"Chemistry", "Roxue Rudues", "2015", "Boston, America", "650", "https://sciarchive.com/chemistry"},
  60.                 {"Biology", "Justine Earl Abdul", "2015", "Boston, America", "500", "https://www.sciarchive.com/biology"},
  61.                 {"Botany", "Aspel Jacobe", "2017", "Texas, California", "620", "https://www.sciarchive.com/botany"},
  62.                 {"Ethnics", "Royde Rex","2019", "Indonesia", "480", "https://www.humannature.com/ethnics"},
  63.                 {"Tradition and Culture", "Ashlie Reymart", "2019", "Manila, Philippines", "790", "https://likas.org/tradition-and-culture"},
  64.                 {"Multimedia", "Roylyn Axel", "2018", "Hongkong", "290", "https://anglecam.com/multimedia"},
  65.                 {"Religions", "Fr. Jacobe Arlenda", "2020", "Rome, Italy", "1500","https://www.humane.com/religions"},
  66.                 {"Computers", "Ron Wesley", "2021", "New Yor City", "500", "https://modernworld.com/computers"}
  67.             };
  68.            
  69.             //welcoming the user
  70.             Console.WriteLine("---------------------------------");
  71.             Console.WriteLine("          REFERENCE BOOK");
  72.             Console.WriteLine("  Created by Jet Francis Podaca");
  73.             Console.WriteLine("---------------------------------\n");
  74.            
  75.             string userName;
  76.             Console.Write("Please Enter your Name: ");
  77.             userName=Console.ReadLine();
  78.             Console.WriteLine();
  79.             Console.WriteLine("  Hello " + userName + ", welcome to Reference Book. I am happy to give you a hand.");
  80.             Console.WriteLine();
  81.            
  82.             //in order to have a loop
  83.             while(true)
  84.             {
  85.                 Console.WriteLine();
  86.                 Console.WriteLine("Please input the tittle of a Book you want.");
  87.                 Console.Write("Book Tittle: ");
  88.                 string booknamesearch = Console.ReadLine();
  89.                 Console.WriteLine();
  90.                
  91.                 string f = "Not Found";
  92.                 //f stands for found
  93.                 for (int i=0;i<book.GetLength(0);i++)
  94.                 {
  95.                     if (booknamesearch == book[i, 0])
  96.                     {
  97.                         Console.WriteLine("Found it!");
  98.                         Console.WriteLine("_________________________________\n");
  99.                         Console.WriteLine("Book Tittle: " + book[i, 0]);
  100.                         Console.WriteLine("Author: " + book[i, 1]);
  101.                         Console.WriteLine("Year Published: " + book[i, 2]);
  102.                         Console.WriteLine("Place of Publication: " + book[i, 3]);
  103.                         Console.WriteLine("Number of Pages: " + book[i, 4] + " pages");
  104.                         Console.WriteLine("\nYou can view or dowload it for free at: " + book[i, 5]);
  105.                         Console.WriteLine("_________________________________");
  106.                         f = "Found";
  107.                     }
  108.                
  109.                 }
  110.                 if (f!="Found")
  111.                 {
  112.                 Console.WriteLine("  Searched Book Not Found!");
  113.                 }
  114.                
  115.                 //ask the user to continue or to exit
  116.                 string answer;
  117.                 Console.WriteLine();
  118.                 Console.Write("Search again? (Yes | No): ");
  119.                 answer=Console.ReadLine();
  120.                 if (answer != "Yes" || answer != "yes")
  121.                
  122.                 {
  123.                 string answer_2;
  124.                 Console.WriteLine();
  125.                 Console.Write("Want to Exit? (Yes | No): ");
  126.                 answer_2=Console.ReadLine();
  127.                     if (answer_2 == "Yes" || answer_2 == "yes")
  128.                     {
  129.                         Environment.Exit(0);
  130.                         //directly exiting the program
  131.                     }
  132.                 }
  133.            
  134.             }
  135.     }
  136. }
  137. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement