Advertisement
Guest User

Untitled

a guest
Aug 30th, 2010
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.08 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApplication1
  4. {
  5.  
  6.     class MyConsoleApp
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             isbn myFavoriteBook = new isbn();
  11.  
  12.             bool isValid = CheckDigit.CheckIsbn(myFavoriteBook.GetIsbn());
  13.             Console.WriteLine(string.Format("Your book {0} a valid ISBN", isValid ? "has" : "doesn't have"));
  14.  
  15.             Console.ReadLine();
  16.         }
  17.     }
  18.  
  19.     public static class CheckDigit
  20.     {
  21.         public static bool CheckIsbn(string isbn)
  22.         {
  23.             //implementation as in your question.
  24.             return true;
  25.         }
  26.     }
  27.  
  28.     public class isbn
  29.     {
  30.         private string isbnNum;
  31.         private int checkDigit;
  32.         private bool isValid;
  33.  
  34.         public string GetIsbn()
  35.         {
  36.             return this.isbnNum;
  37.         }
  38.  
  39.         public isbn()
  40.         {
  41.             Console.Write("Enter Your ISBN Number: ");
  42.             this.isbnNum = Console.ReadLine();
  43.         }
  44.  
  45.         public string displayISBN()
  46.         {
  47.             return this.GetIsbn();
  48.         }
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement