using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace H2
{
class Program
{
struct book
{
string author;
int price;
int yearOfPublication;
string bookName;
public string getAuthor()
{
return author;
}
public void setAuthor(string _author)
{
author = _author;
}
public int getPrice()
{
return price;
}
public void setPrice(int _price)
{
price = _price;
}
public int getYearOfPublication()
{
return yearOfPublication;
}
public void setYearOfPublication(int _yearOfPublication)
{
yearOfPublication = _yearOfPublication;
}
public string getBookName()
{
return bookName;
}
public void setBookName(string _bookName)
{
bookName = _bookName;
}
public void showInformation()
{
Console.WriteLine("author:" + author);
Console.WriteLine("book name:" + bookName);
Console.WriteLine("price:" + price);
Console.WriteLine("year of publication:" + yearOfPublication);
}
public void setParam(book _bk)
{
author = _bk.getAuthor();
price = _bk.price;
yearOfPublication = _bk.getYearOfPublication();
bookName = _bk.getBookName();
}
/********** Begin *********/
//your function
public void setParam(string _author, int _price, int _yearOfPublication, string _bookName)
{
author = _author;
price = _price;
yearOfPublication = _yearOfPublication;
bookName = _bookName;
}
/********** End *********/
}
static void Main(string[] args)
{
book yourBook = new book();
//book myBook = new book();
//myBook.setAuthor("Hemingway");
//myBook.setBookName("The Old Man and the Sea");
//myBook.setPrice(30);
//myBook.setYearOfPublication(1952);
//yourBook.setParam(myBook);
/********** Begin *********/
//Use your functions instead of comments section
yourBook.setParam("Hemingway", 30, 1952, "The Old Man and the Sea");
/********** End *********/
yourBook.showInformation();
}
}
}