コード例 #1
0
ファイル: Program.cs プロジェクト: ehzawad/CSharpVector
        static void Main(string[] args)
        {
            // BOOK

            Book csharpBook = new Book("C#", "Microsoft", "101", "Language", 5);

            csharpBook.ShowInfo();

            Book javaBook = new Book("Java By Gosling", "Oracle", "102", "Language", 2);

            javaBook.AddBookCopy(2);
            javaBook.ShowInfo();

            Book devOps = new Book()
            {
                BookName   = "Learn Vim",
                BookAuthor = "Bram",
                BookId     = "103",
                BookType   = " Software development",
                BookCopy   = 2
            };


            //Book dummy = new Book();
            //dummy.ShowInfo();

            devOps.AddBookCopy(4);
            devOps.ShowInfo();

            Book.ShowTotalBookInfo();

            // CONTACT
            //Contact hafezul = new Contact("Hafezul Talukder", "42225", 17, "017XXXX", 'M');
            //hafezul.DetectMobileOperator();
            //hafezul.ShowPersonInfo();

            // ACCOUNT
            //    Account a = new Account();
            //    Console.WriteLine("Input Account Info:\n" + "Account Name: ");
            //    a.AccName = Console.ReadLine();
            //    Console.WriteLine("AccId:");
            //    a.Acid = Console.ReadLine();
            //    Console.WriteLine("Balance:");
            //    a.Balance = Convert.ToDouble(Console.ReadLine());

            //    //enter deposit amount
            //    Console.WriteLine("Enter deposit amount: ");
            //    a.Deposit(Convert.ToDouble(Console.ReadLine()));

            //    Console.WriteLine("Enter Withdraw Amount");
            //    a.WithDraw(Convert.ToDouble(Console.ReadLine()));

            //    Console.WriteLine("Your Bank Account Info" + "\nName:" + a.AccName + "\nId: " + a.Acid + "\nBalance: " + a.Balance);

            //    Console.WriteLine("Enter amount you want to transfer: ");
            //    double transferAmount = Convert.ToDouble(Console.ReadLine());
            //    a.Transfer(transferAmount, new Account("Sohan", "15-30111-2", 0.000));
            //    Console.WriteLine("Your Bank Account Info" + "\nName:" + a.AccName + "\nId: " + a.Acid + "\nBalance: " + a.Balance);
            //}
        }
コード例 #2
0
ファイル: Start.cs プロジェクト: shahriar-alam/csharp-lab
        static void Main(string[] args)
        {
            Book a = new Book();

            a.BookName   = "A";
            a.BookId     = "1";
            a.BookAuthor = "AA";
            a.BookType   = "AAA";
            a.BookCopy   = 100;

            Book b = new Book("B", "BB", "2", "BBB", 50);

            a.ShowInfo();
            b.AddBookCopy(20);
            b.ShowInfo();
            Book.ShowTotalBookInfo();
        }
コード例 #3
0
            static void Main(string[] args)
            {
                Student s = new Student("Jannatul", "19-40374-1", "CSE", 3.72f);

                s.ShowInfo();
                

                Book b = new Book("sashar kobita", "Rrobindronath", "10", "upponnash", 200);
                b.ShowInfo();
                

                

                b.AddBookCopy(10);
                b.ShowInfo();
               

                Account sa = new Account("jannatul", "19403741", 10000);
                sa.ShowInfo();
                

                Library l = new Library("New library, "danmondi"," dhaka", 30000);
                l.ShowLibInfo();
               




                l.AddNewBook(b);
                
           
                l.ShowAllBooks();

                l.AddNewBookCopy(b, 70);


                l.ShowAllBooks();

            }
コード例 #4
0
        static void Main(string[] args)
        {
            /*Account acc = new Account();
             * Account acc2 = new Account();
             * Console.Write("Your Account Name: ");
             * acc.Name = Console.ReadLine();
             * Console.Write("Your Account ID: ");
             * acc.Id = Console.ReadLine();
             * Console.Write("Your Account Balance: ");
             * acc.Balance = double.Parse(System.Console.ReadLine());
             * Console.Write("\n");
             * acc.ShowAll();
             *
             * Console.Write("\n\nYour Account Name 2nd: ");
             * acc2.Name = Console.ReadLine();
             * Console.Write("Your Account ID 2nd: ");
             * acc2.Id = Console.ReadLine();
             * Console.Write("Your Account Balance 2nd: ");
             * acc2.Balance = double.Parse(System.Console.ReadLine());
             * Console.Write("\n");
             * acc2.ShowAll();
             *
             * Console.Write("\nType How Much Money You Want To Deposit In Your Account: ");
             * acc.Deposit(double.Parse(Console.ReadLine()));
             * Console.WriteLine("After Deposit Showing All.");
             * acc.ShowAll();
             * Console.Write("Type How Much Money You Want To Tranfer Into "+acc2.Name+"'s Account: ");
             * acc.Transfer(double.Parse(Console.ReadLine()), acc2);
             * Console.WriteLine("\nAfter Transfer Account 1 to Account 2. Showing All.");
             * Console.WriteLine("\nAccount 1 Show All.");
             * acc.ShowAll();
             * Console.WriteLine("\nAccount 2 Show All.");
             * acc2.ShowAll();*/

            Book b1 = new Book("Book 1", "asif 1", "1", "Drama", 50);
            Book b2 = new Book("Book 2", "asif 2", "2", "Drama", 100);
            Book b3 = new Book("Book 3", "asif 3", "3", "Drama", 150);

            /*Book b4 = new Book("Book 4", "asif 1", "1", "Drama", 50);
             * Book b5 = new Book("Book 5", "asif 2", "2", "Drama", 100);
             * Book b6 = new Book("Book 6", "asif 3", "3", "Drama", 150);*/
            Console.WriteLine("\nBook 1 Show All.");
            b1.ShowInfo();
            Console.WriteLine("\nBook 2 Show All.");
            b2.ShowInfo();
            Console.WriteLine("\nBook 3 Show All.");
            b3.ShowInfo();
            b2.BookCopy = 500;
            Book.ShowTotalBookInfo();
            b1.AddBookCopy(10);

            Contact a = new Contact();

            /*Console.WriteLine("\n\nType Your Name First: ");
             * a.PersionName = Console.ReadLine();
             * Console.WriteLine("\nType Your ID: ");
             * a.PersionId = Console.ReadLine();
             * Console.WriteLine("\nMobile Number: ");
             * a.MobileNumber = Console.ReadLine();
             * Console.WriteLine("\nYour Age: ");
             * a.Age = int.Parse(Console.ReadLine());
             * Console.WriteLine("\nYour Gender (M/F) : ");
             * a.Gender = char.Parse(Console.ReadLine());
             *
             * a.DectectMobileNumber();*/
            //Console.WriteLine(a.IsValidEmail("*****@*****.**"));

            /*int[] arr = new int[int.Parse(Console.ReadLine())];
             * for (int i = 0; i < arr.Length; i++)
             * {
             *  arr[i] = i;
             * }
             * for (int i = 0; i < arr.Length; i++)
             * {
             *
             *  Console.WriteLine("\nYour Array Is : "+arr[i]);
             * }*/
            /*ArrayList aa = new ArrayList(5);
             * aa.Add(33);
             * aa.Add(11);
             * aa.Add(44);
             * aa.Add(22);
             * aa.Add(77);
             * for (int t = 0; t < aa.Count; t++)
             * {
             *  Console.WriteLine(aa[t]);
             * }*/


            System.Console.ReadKey();
        }
コード例 #5
0
 public void AddNewBookCopy(Book book, int copy)
 {
     book.AddBookCopy(copy);
 }