Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Topic: Java Programming Hello, I have the following code attached below, and keep getting told that Television on the 23rd line cannot be resolved to

Topic: Java Programming

Hello,

I have the following code attached below, and keep getting told that "Television" on the 23rd line "cannot be resolved to a type". It happens on this line of code...

Television portable = new Television("Sharp", 19);

Can you tell me how to fix this?

Beginning of code...

import java.util.Scanner;

public class TelevisionDemo {

{}

public static void main(String[] args)

{

// //create a Scanner object to read from the keyboard

Scanner keyboard = new Scanner(System.in);

// //declare variables

int station; //the user's channel choice

// //HERE IS WHERE YOU DO TASK #5

Television portable = new Television("Sharp", 19);

portable.power();

System.out.println("A " + portable.getScreenSize() + " inch " +

portable.getManufacturer() + " has been turned on.");

System.out.print("What channel do you want? ");

station = keyboard.nextInt();

//change the channel on the television

portable.setChannel(station);

portable.decreaseVolume();

portable.decreaseVolume();

System.out.println("Channel: " + portable.getChannel() +

" Volume: " + portable.getVolume());

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions