Guest User

Untitled

a guest
Oct 18th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace ConsoleApp23
  5.  
  6. {
  7.  
  8. class Program
  9.  
  10. {
  11.  
  12. static void Main(string[] args)
  13.  
  14. {
  15.  
  16. Driver d1 = new Driver();
  17.  
  18. d1.runTest1();
  19.  
  20. }
  21.  
  22. }
  23.  
  24.  
  25.  
  26. class Driver
  27.  
  28. {
  29.  
  30. public void runTest1()
  31.  
  32. {
  33.  
  34. ATM a1 = new ATM();
  35.  
  36. Console.WriteLine("Please enter PIN CODE:");
  37.  
  38. String userCode = Console.ReadLine();
  39.  
  40. a1.set_PINNumber(userCode);
  41.  
  42. Console.WriteLine(a1.get_PINNumber());
  43.  
  44. Console.ReadLine();
  45.  
  46. }
  47.  
  48. }
  49.  
  50.  
  51.  
  52. class ATM
  53.  
  54. {
  55.  
  56. private String PINNumber;
  57.  
  58.  
  59.  
  60. public void set_PINNumber(String pinNumber)
  61.  
  62. {
  63.  
  64. if (doSecurityCheck())
  65.  
  66. {
  67.  
  68. PINNumber = pinNumber;
  69.  
  70. Console.WriteLine("Passes Security Check");
  71.  
  72. Console.ReadLine();
  73.  
  74. }
  75.  
  76. else
  77.  
  78. {
  79. Console.WriteLine("Notify Bank Security");
  80.  
  81. Console.ReadLine();
  82.  
  83. }
  84.  
  85. }
  86.  
  87.  
  88.  
  89. public String get_PINNumber()
  90.  
  91. {
  92.  
  93. return PINNumber;
  94.  
  95. }
  96.  
  97.  
  98.  
  99. private bool doSecurityCheck()
  100.  
  101. {
  102.  
  103. return true;
  104.  
  105. }
  106.  
  107.  
  108.  
  109.  
  110.  
  111. }
  112.  
  113.  
  114.  
  115. class Dating
  116.  
  117. {
  118.  
  119. // what starts at the beginning:
  120.  
  121. Driver d1 = new Driver();
  122.  
  123. d1.runTest1();
  124.  
  125. }
  126.  
  127. }
  128.  
  129.  
  130.  
  131. class Driver
  132.  
  133. {
  134.  
  135. public void runTest1()
  136.  
  137. {
  138.  
  139. Dating date1 = new Dating();
  140.  
  141. date1.codeSegmentA();
  142.  
  143. }
  144.  
  145. }
  146.  
  147.  
  148.  
  149. class Dating
  150.  
  151. {
  152.  
  153. public void codeSegmentA()
  154.  
  155. {
  156.  
  157. aDate d1 = new aDate("Jordan, Dog");
  158.  
  159. Console.WriteLine(d1.getName());
  160.  
  161. Console.ReadLine();
  162.  
  163. }
  164.  
  165. }
  166.  
  167.  
  168.  
  169. class aDate
  170.  
  171. {
  172.  
  173. private String name;
  174. private String favouritePet;
  175. // what is a constructor?
  176.  
  177. // a constructor is a method: it called automatically
  178.  
  179. // when you create a class
  180.  
  181. // 3 attributes of the Constructor:
  182.  
  183. // 1. Always PUBLIC
  184.  
  185. // 2. NO return type
  186.  
  187. // 3. named the same as the class name!
  188.  
  189.  
  190.  
  191. public aDate(String aName)
  192.  
  193. {
  194.  
  195. this.name = aName;
  196.  
  197. }
  198. public aDate(String aName, String aPet)
  199.  
  200. {
  201. name = aName;
  202. favouritePet = aPet;
  203. Console.WriteLine("We are in the 2 argument Constructor now");
  204. }
  205.  
  206.  
  207.  
  208.  
  209. }
  210.  
  211.  
  212. class Library
  213.  
  214. {
  215.  
  216. public void runLibrary()
  217.  
  218. {
  219.  
  220.  
  221.  
  222. }
  223.  
  224. }
  225.  
  226.  
  227.  
  228. class Borrower
  229.  
  230. {
  231.  
  232. public List<Book> Books;
  233.  
  234. public Borrower()
  235.  
  236. {
  237.  
  238. Books = new List<Book>();
  239.  
  240. }
  241.  
  242. }
  243.  
  244.  
  245.  
  246. class Book
  247.  
  248. {
  249.  
  250.  
  251.  
  252. public Book()
  253.  
  254. {
  255.  
  256.  
  257.  
  258. }
  259.  
  260. }
Add Comment
Please, Sign In to add comment