Create a java class named headphones

Assignment Help JAVA Programming
Reference no: EM13929135

1. Create a Java class named HeadPhones to represent a headphone set. The class contains:

Three constants named LOW, MEDIUM and HIGH with values of 1, 2 and 3 to denote the headphone volume.

  • A private int data field named volume that specifies the volume of the headphone. The default volume is MEDIUM.
  • A private boolean data field named pluggedIn that specifies if the headphone is plugged in. The default value if 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.
  • getter and setter methods for all data fields.
  • A no argument constructor that creates a default headphone.
  • A method named toString() that returns a string describing the current field values of the headphones.
  • A method named changeVolume(value) that changes the volume of the headphone to the value passed into the method

Create a TestHeadPhones class that constructs at least 3 HeadPhones objects. For each of the objects constructed, demonstrate the use of each of the methods. Be sure to use your IDE to accomplish this assignment.

2. Create your own Java class that represents your favorite musical instrument. Your musical instrument class should have at least 3 constants, 4 private data fields, getters and setters for each private data field, a toString() method, and two additional methods of your choice. Create a test class that constructs at least 3 of your musical instrument objects. For each of the objects constructed demonstrate the use of each of the methods. Be sure to use your IDE to accomplish this assignment. You can pick any instrument you want. When designing your class, think about what would make sense to describe and use the instrument. For example, if you selected a trumpet, you might need to provide the number of valves, the manufacturer, if the instrument is using a mute, and the volume or even notes the trumpet is playing. Make this your own creation and have fun with it.

Reference no: EM13929135

Questions Cloud

Draw the free body diagram of the rider : The Raptor is an outside loop roller coaster in which riders are belted into seats resembling ski-lift chairs. Draw the Free-Body-Diagram of the rider at the highest position in the loop.
Mean test scores of the two groups : What is the calculated t value? Are the mean test scores of these two groups significantly different at the .05 level?
Developing a capacity plan : 1. What is the important starting point in developing a capacity plan? 2. What is another name for the fixed-order quantity inventory model?
Determine how five guys'' philosophy sets : Assess how ethical and social practices are part of the Five Guys' culture and provide examples to support your choices.5.
Create a java class named headphones : 1. Create a Java class named HeadPhones to represent a headphone set. The class contains:
Should adjusted at certain points in transformation process : Should pay be linked to the present or expected value to the organization? Should pay be adjusted at certain points in transformation process?
Why are some countries rich while others are poor : In order to find effective solutions to world poverty, one must first understand its cause. Thus, why are some countries rich while others are poor
Mean waiting time at the car wash : QUESTION 1: Car wash waiting times at the local convenience store follow a uniform distribution. The wait time ranges from 0-16 minutes. What is the mean waiting time at the car wash?
Negative characteristics of a criminal investigator : Determine the fundamental positive and negative characteristics of a criminal investigator. Include at least two (2) examples from real life or stories from television and newspaper to support your response

Reviews

Write a Review

JAVA Programming Questions & Answers

  Album name instance variable

Design a CD class where a CD object represents a single music CD. What kinds of information (artist, genre, total playing time, etc.) do you want to know about a CD?StateAlbum Name instance variable

  Design 3 shoppingbay is an online auction service that

3. shoppingbay is an online auction service that requires several reports. design a flowchart or psuedocode this is

  How are they used in javadoc comments

What is a tag and how are they used in Javadoc comments?

  Need a console program

Need a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower, or Mixed).

  Determine the precise big-oh values

Determine the precise Big-Oh values for each of the following code samples, based on the number of statement executions - Remember to consider each statement in compound statements separately.

  Java project

Prompt the user for an int between lower and upper boundary.

  Write java application that effectively uses java collection

Write a Java application that effectively uses Java collections to store up to 20 instances of the Person class and its subclasses. Then write a GUI that displays the Person names using radio buttons to select a value

  Create a java program that performs distributed systems task

Can someone create a Java program that performs the following distributed systems tasks? This should be easy for a Java programmer

  Calculate the body mass index

Write an application (BMICalc) that reads the user's weight in poinds and height in inches, then calculates the Body Mass Index.

  Constructing a simple flowchart that describes simple logic

Constructing a simple flowchart that describes simple logic flow through a program. Translating the flowchart into pseudo code. Creating a simple module, based on the pseudo code created in step 2, which accepts a parameter and returns a value.

  Write a java program that uses a search tree of strings

Write a Java program that uses a search tree of strings to sort text lines in alphabetic order. You may choose how you de?ne alphabetic order as long as there is some sense in the de?nition. You may also choose what kind of tree you use.

  Create java servlets

Create a new JSON "view" (e.g., a JSP page that only displays the JSON representation of the data)

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