Question Details

(Solved) /*** Description:


Here is my code. What am I doing wrong? The headphones.java code will compile but when I type in the TestHP file it will not compile. I get one error, Why?

/*** Description: This program creates a headphone class, * constructors, getter
and setter methods and * methods to set and return values */package headphones;
public class Headphones { //final types
final static int Low = 1;
final static int Medium = 2;
final static int High = 3;
//private types
private int volume;
private boolean pluggedIn =
false;
private String manufacturer;
private String headphonecolor;
//constructors
public Headphones() { volume = Medium;
pluggedIn =
false;
manufacturer = "Sony";
headphonecolor = "black";
} public
Headphones(int Hvolume, boolean HpluggedIn,
String Hmanufacturer, String
Hheadphonecolor) { volume =Hvolume;
pluggedIn = HpluggedIn;
manufacturer = Hmanufacturer;
headphonecolor = Hheadphonecolor;
} //get methods
public int getvolume() { System.out.println("Current
volume level is "+volume)
;
return volume;
} public boolean
getpluggedIn() { System.out.println("Plugged in status is "+pluggedIn)
;
return pluggedIn;
} public String getmanufacturer() { System.out.println("Current Maker is "+manufacturer)
;
return manufacturer;
} public String getheadphonecolor() { System.out.println("Current
Color is "+headphonecolor)
;
return headphonecolor;
} //set methods
public void setvolume(int Hvolume) { volume = Hvolume;
} public
void setpluggedin(boolean HpluggedIn) { pluggedIn = HpluggedIn;
} public void setmanufacturer(String Hmanufacturer) { manufacturer =
Hmanufacturer;
} public void setheadphonecolor(String Hheadphonecolor) { headphonecolor = Hheadphonecolor;
} //to string method
public
String tostring() { String str = "Volume level = " + volume + ". Plugged in
status = " + pluggedIn
+ ". Headphone Manufacturer = " + manufacturer + ".
Headphone color = " + headphonecolor;
System.out.println(str)
;
return str;
} //change volume method
public void changevolume(int Cvolume) { volume = Cvolume;
} }

 


Solution details:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Sep 05, 2019

PRICE: $18

Solution~000200235375.zip (25.37 KB)

Buy this answer for only: $18

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free solution (Deadline assured. Flexible pricing. TurnItIn Report provided)

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Sep 05, 2019

EXPERT

Tutor

ANSWER RATING

GET INSTANT HELP/h4>

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN YOUR SET DEADLINE.

Order Now