Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace Looper
- {
- class Book
- {
- private int _numberPage;
- private int _totalPage;
- private string _name;
- private string[] _chapters;
- public Book(int numberPage, int totalPage,
- string name, string[] chapters)
- {
- _numberPage = numberPage;
- _totalPage = totalPage;
- _name = name;
- _chapters = chapters;
- }
- public void ShowInfo()
- {
- Console.WriteLine(_numberPage);
- Console.WriteLine(_totalPage);
- Console.WriteLine(_name);
- //for (int i = 0; i < _chapters.Length; i++)
- //{
- // Console.WriteLine(_chapters[i]);
- //}
- foreach (var chapter in _chapters)
- {
- Console.WriteLine(chapter);
- }
- }
- public void UpdateName(string name)
- {
- _name = name;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement