Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication1
- {
- class Show
- {
- int showId;
- int roomId;
- string languageVersion;
- int day;
- int mounth;
- double hour;
- public Show()
- {
- showId = 0;
- roomId = 0;
- languageVersion = "";
- day = 0;
- mounth = 0;
- hour = 0;
- }
- public Show ( int _showId, int _roomId, string _languageVersion, int _day,int _mounth, float _hour)
- {
- showId = _showId;
- roomId = _roomId;
- languageVersion = _languageVersion;
- day = _day;
- mounth = _mounth;
- hour = _hour;
- }
- public Show setShowId (int _showId)
- {
- if (_showId > 99999 && _showId < 1000000)
- {
- showId = _showId;
- return this;
- }else
- throw new System.ArgumentException("Wrong showId");
- }
- public Show setRoomId (int _roomId)
- {
- if (_roomId > 99999 && _roomId < 1000000)
- {
- roomId = _roomId;
- return this;
- }else
- throw new System.ArgumentException("Wrong roomId");
- }
- public Show setlanguageVersion(string _languageVersion)
- {
- if (_languageVersion.Length < 50){
- languageVersion = _languageVersion;
- return this;
- }else
- throw new System.ArgumentException("Wrong language version");
- }
- public Show setDay(int _day)
- {
- if (_day > 0 && _day < 32)
- {
- day = _day;
- return this;
- }else
- throw new System.ArgumentException("Wrong day");
- }
- public Show setMounth(int _mounth)
- {
- if (_mounth > 0 && _mounth < 13)
- {
- mounth = _mounth;
- return this;
- }else
- throw new System.ArgumentException("Wrong mounth");
- }
- public Show setHour(double _hour)
- {
- if (_hour >= 0.0 && _hour < 23.59)
- {
- hour = _hour;
- return this;
- }
- throw new System.ArgumentException("Wrong hour");
- }
- public int getShowId()
- {
- return showId;
- }
- public int getRoomId()
- {
- return roomId;
- }
- public string getLanguageVersion()
- {
- return languageVersion;
- }
- public int getDay()
- {
- return day;
- }
- public int getMounth()
- {
- return mounth;
- }
- public double getHour()
- {
- return hour;
- }
- }
- class Room
- {
- int roomId;
- string roomName;
- int seatsAmount;
- public Room()
- {
- roomId = 0;
- roomName = "";
- seatsAmount = 0;
- }
- public Room(int _roomId, string _roomName, int _seatsAmount)
- {
- roomId = _roomId;
- roomName = _roomName;
- seatsAmount = _seatsAmount;
- }
- public Room setRoomId( int _roomId)
- {
- if( _roomId > 99999 && _roomId < 1000000)
- {
- roomId = _roomId;
- return this;
- }else
- throw new System.ArgumentException("Wrong room Id");
- }
- public Room setRoomName( string _roomName)
- {
- if (roomName.Length < 50)
- {
- roomName = _roomName;
- return this;
- }else
- throw new System.ArgumentException("Wrong room ame");
- }
- public Room setSeatsAmount(int _seatsAmount)
- {
- if (_seatsAmount > 11 && _seatsAmount < 50)
- {
- seatsAmount = _seatsAmount;
- return this;
- }else
- throw new System.ArgumentException("Wrong seats amount");
- }
- public int getRoomId()
- {
- return roomId;
- }
- public string getRoomName()
- {
- return roomName;
- }
- public int getSeatsAmount()
- {
- return seatsAmount;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Show show1 = new Show();
- show1.setShowId(123456).setRoomId(654321)
- .setlanguageVersion("ENGLISH")
- .setDay(5)
- .setMounth(8)
- .setHour(12.35);
- Room room1 = new Room();
- room1.setRoomId(111111)
- .setRoomName("Room4Hoorros")
- .setSeatsAmount(35);
- Console.WriteLine(show1.getLanguageVersion());
- Console.WriteLine(room1.getRoomId());
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement