View the step-by-step solution to:

How can i get the underlined and bolded line to say power is on. Tried replacing it but keeps giving me errors or something i never seen before....

How can i get the underlined and bolded line to say power is on. Tried replacing it but keeps giving me errors or something i never seen before. Please explain what happened im lost.


public class Television {


  public boolean tvIsOn = false;

  public int Channel = 8;


  public Television() {

    this.tvIsOn = false;

    this.Channel = 0;

  }

//Parameters

  public void Channel(boolean tvIsOn, int Channel) {

    this.tvIsOn = tvIsOn;

    this.Channel = Channel;

  }

//Turning on 

  public void TvPower() {

    this.tvIsOn = true;

  }

//Set 

  public void setChannel(int Channel) {

    this.Channel = Channel;

  }

//Get 

  public int getChannel() {

    return this.Channel;

  }

//Method

  public static void main(String[] args) {

    Scanner scanner = new Scanner(System.in);

//Input // Output//

    Television Television1 = new Television();

    System.out.println("Welcome to your New TV experience!");

    System.out.println("Your TV is Currently :" + (Television1.tvIsOn ? "On" : "Off"));

    System.out.println("Your watching Channel: " + Television1.getChannel());

    System.out.println();


    Television Television2 = new Television();

    Television2.Channel(true, 2);

    System.out.println("Power is: " + Television2.tvIsOn);

    System.out.print("Please select your Channel : ");

    Television2.Channel = scanner.nextInt();

    System.out.println();


    System.out.println("Your TV is Currently :" + (Television2.tvIsOn ? "On" : "Off"));

    System.out.println("Your watching Channel: " + Television2.getChannel());

    System.out.println();


  }

}

Top Answer

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online