Create a headphone object with specified manufacturer

Assignment Help JAVA Programming
Reference no: EM131596729

Create a Java class named HeadPhone to represent a headphone set. The class contains:
- Three integer constants named LOW, MEDIUM, and HIGH with values of 1, 2, and 3.
- A private int data field named volume that contains the volume setting of the headphone. The default value is HIGH.
- A private boolean data field named pluggedIn that specifies if the headphone is plugged in. The default value is false.
- A private String data field named manufacturer that specifies the name of the manufacturer of the headphones.
- A private Color data field named headPhoneColor that specifies the color of the headphones. This must be an object of the java.awt.Color class. (You will need to look up the features of this class.)
- A two-argument constructor that creates a HeadPhone object with specified manufacturer name and color, and default values for all other data fields.
- A method named toString() that returns a String object describing the current field values of the headphone.
- A method named changeVolume(int value) that changes the volume of the headphone to the value passed into the method. If the provided value is invalid, the volume shall not be changed.
- getter methods for all data fields, and setter methods for all data fields except manufacturer name and device color and volume. ()
(Note: It's not appropriate to provide "set" methods for the manufacturer and color because in the real world, manufacturer and color of a shipped product cannot be changed. Also, we don't want a "set" method for volume because that function is provided by the changeVolume method, which provides the needed input data validation.)
Create a TestHeadPhone main class to test the HeadPhone class. For each test, the necessary inputs shall be obtained from the tester (user). Each feature of the Headphone class shall be tested by comparing outputs from the getter methods to the required values. Test three different headphones. (Hint: put the test code in a loop.)
Use your IDE to accomplish this assignment.
Grading criteria are the same as for Assignments 1 and 2, and so are not restated here.
Submission requirements
Java Style:
- Header comments include filename, author, date, and brief description of the purpose of the program
- In-line comments as needed to explain any non-obvious code.
- Meaningful variable names and user prompts
- Class names in UpperCamelCase

Attachment:- Java code.rar

Reference no: EM131596729

Questions Cloud

Determine effect the may have on the decision making process : Determine the effect this may have on the decision making process. Evaluate the influence that corporate social responsibility has on the organization.
Explain the private and public health insurance : Provide a definition of both private and public health insurance, and discuss the differences between private and public health insurance.
Analytical and command schools of jurisprudence : What is the difference between the Analytical and Command Schools of jurisprudence?
Describe the foreseen security risks : For this assessment, imagine that you are the IT manager for the only print shop in a small town in Idaho. The shop is connected to the internet by satellite.
Create a headphone object with specified manufacturer : two-argument constructor that creates a HeadPhone object with specified manufacturer name and color, and default values for all other data fields
Periods of increasing demand and conducting layoffs : What are the advantages and disadvantages of using the option of hiring additional personnel during periods of increasing demand and conducting layoffs
Diverse group of individuals towards : Using the internet and your text, examine how an organization motivates a diverse group of individuals towards a common goal on the following:
Describe the six developmental tasks that are necessary : Describe the six developmental tasks that are necessary for long-term success. Discuss the keys to success in developing Stage I and Stage II organizations.
Communication technique and presentations : This topic involves analyzing a communication technique and presentations. On a daily basis, it is often expected that professionals be proficient.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Compute the temperature in centigrade

Compute the temperature in Centigrade - Display the temperatures in both Centrigrade and Fahrenheit with appropriate labels, using the + operator to concatenate the labels with the variables

  Generates useful word lists for scrabble players

This requires a class, WordLists, in Java that generates useful word lists for scrabble players using this list - A test class must be written for the WordLists

  What are three import descriptors about a car

What are three import descriptors about a car, things you want to know about the object - write one default constructor

  Explains the overview and the structure of your program

Final result should be organized as a document which explains the overview and the structure of your program, real code, execution results (including captured image), and the conclusion including justification of your program.

  Write a program to compute the cumulative gpa

This program will compute the cumulative GPA based on user input.  This program will use dialog boxes with the JOptionPane class as well as the console to send/receive information to/from the user.

  On any given execution your program

On any given execution your program will produce just one version of the figure. However, you should refer to the class constant throughout your code, so that by simply changing your constant's value and recompiling, your program would produce a f..

  Write a class called square that is child class of rectangle

Write a class called Square that is a child class of Rectangle. A square is a rectangle with equal sides. It should inherit the perimeter() and area() methods.

  Tutorial on taking a screen shot

If you need a tutorial on taking a screen shot, visit one of the following locations: (PC users: http://www.take-a-screenshot.org/) (MAC users: http://binged.it/1xriOcN).

  List two or three topics of java programming

Explain their importance and give an example of each. List two or three topics you need to work on to better understand their concepts

  Write a java program that has a method named atomic

Demonstrate in the program how two threads can, sometimes, invoke atomic() concurrently.

  Design and implement a basic graphical user interface

Design and implement a basic graphical user interface (GUI) program for recording information about a family tree -

  Modify the java application using java netbeans ide

Modify the Java application using Java NetBeans IDE to meet these additional and changed business requirements

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd