Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Nauka
- {
- class Books
- {
- static string bookTitle;
- static string bookAuthor;
- int publishYear;
- string booklet = $"{bookTitle} {bookAuthor}";
- List<string> bookList = new List<string>();
- public string getBookData()
- {
- //this.bookTitle = bookTitle;
- //this.bookAuthor = bookAuthor;
- Console.Write("Book\'s title:\t");
- bookTitle = Console.ReadLine();
- Console.Write("Book\'s Author:\t");
- bookAuthor = Console.ReadLine();
- booklet = $"{bookAuthor} {bookTitle}";
- //bookList.Add(booklet);
- Console.WriteLine($"{bookTitle}:\t{bookAuthor}");
- return $"{bookAuthor} {bookTitle}";
- }
- public string printList()
- {
- bookList.Add(booklet);
- Console.WriteLine("Nasza lista kasiążek zawiera:");
- Console.WriteLine($"liczba książek na liście wynosi {bookList.Count}");
- foreach (var book in bookList)
- {
- Console.WriteLine(book);
- }
- return booklet;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- var book1 = new Books();
- var volumens = new Books();
- book1.getBookData();
- volumens.printList();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement