Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApplication1
- {
- class MyConsoleApp
- {
- static void Main(string[] args)
- {
- isbn myFavoriteBook = new isbn();
- bool isValid = CheckDigit.CheckIsbn(myFavoriteBook.GetIsbn());
- Console.WriteLine(string.Format("Your book {0} a valid ISBN", isValid ? "has" : "doesn't have"));
- Console.ReadLine();
- }
- }
- public static class CheckDigit
- {
- public static bool CheckIsbn(string isbn)
- {
- //implementation as in your question.
- return true;
- }
- }
- public class isbn
- {
- private string isbnNum;
- private int checkDigit;
- private bool isValid;
- public string GetIsbn()
- {
- return this.isbnNum;
- }
- public isbn()
- {
- Console.Write("Enter Your ISBN Number: ");
- this.isbnNum = Console.ReadLine();
- }
- public string displayISBN()
- {
- return this.GetIsbn();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement