Advertisement
Jet_Francis_Podaca

Reference Book

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