package tv;
import java.util.Scanner;
import java.lang.Math;
public class TV {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
TvWatch();
}
public static void TvWatch()
{
Scanner sc = new Scanner(System.in);
TvSeria s = new TvSeria(1);
System.out.println("Выберите серию:");
int MoveTochannel = sc.nextInt() ;
if(s.IsAllTvSeria(MoveTochannel));
{
s.move(MoveTochannel);
}
{
TvWatch();
}
}
}
package tv;
import java.util.Scanner;
import java.lang.Math;
public class TvSeria {
public TvSeria(int tvseria){
this.currentchannel = tvseria ;
}
public int currentchannel ;
public final int channelLimit = 25;
public void move (int nextchannel) {
this.currentchannel = nextchannel;
System.out.println("Вы смотрите " + nextchannel + "серию");
}
public boolean IsAllTvSeria(int tvseria) {
if(channelLimit >tvseria) {
return true ;
}
else {
System.out.println("Не существует:");
return false ;
}
}
public void PreviousChannel(int channel) {
System.out.println("Предыдущий канал:");
}
}