Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace ConsoleApp23
- {
- class Program
- {
- static void Main(string[] args)
- {
- Driver d1 = new Driver();
- d1.runTest1();
- }
- }
- class Driver
- {
- public void runTest1()
- {
- ATM a1 = new ATM();
- Console.WriteLine("Please enter PIN CODE:");
- String userCode = Console.ReadLine();
- a1.set_PINNumber(userCode);
- Console.WriteLine(a1.get_PINNumber());
- Console.ReadLine();
- }
- }
- class ATM
- {
- private String PINNumber;
- public void set_PINNumber(String pinNumber)
- {
- if (doSecurityCheck())
- {
- PINNumber = pinNumber;
- Console.WriteLine("Passes Security Check");
- Console.ReadLine();
- }
- else
- {
- Console.WriteLine("Notify Bank Security");
- Console.ReadLine();
- }
- }
- public String get_PINNumber()
- {
- return PINNumber;
- }
- private bool doSecurityCheck()
- {
- return true;
- }
- }
- class Dating
- {
- // what starts at the beginning:
- Driver d1 = new Driver();
- d1.runTest1();
- }
- }
- class Driver
- {
- public void runTest1()
- {
- Dating date1 = new Dating();
- date1.codeSegmentA();
- }
- }
- class Dating
- {
- public void codeSegmentA()
- {
- aDate d1 = new aDate("Jordan, Dog");
- Console.WriteLine(d1.getName());
- Console.ReadLine();
- }
- }
- class aDate
- {
- private String name;
- private String favouritePet;
- // what is a constructor?
- // a constructor is a method: it called automatically
- // when you create a class
- // 3 attributes of the Constructor:
- // 1. Always PUBLIC
- // 2. NO return type
- // 3. named the same as the class name!
- public aDate(String aName)
- {
- this.name = aName;
- }
- public aDate(String aName, String aPet)
- {
- name = aName;
- favouritePet = aPet;
- Console.WriteLine("We are in the 2 argument Constructor now");
- }
- }
- class Library
- {
- public void runLibrary()
- {
- }
- }
- class Borrower
- {
- public List<Book> Books;
- public Borrower()
- {
- Books = new List<Book>();
- }
- }
- class Book
- {
- public Book()
- {
- }
- }
Add Comment
Please, Sign In to add comment