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

  Java graphics-write an application that extends jframe and

java graphics-write an application that extends jframe and that displays a phrase in every font size from 6 through

  Create a scatterplot visualization

Create a Scatterplot visualization that reads data from a comma-separated text file. The visualization code should be written in Java using Processing.

  Write a method to get list of all the books

Make a map for a book with Book ISBN as key and book title as value - Write a method to get list of all the books in JSON format using restul client.

  A game of tic-tac-toe

A game of tic-tac-toe, two players (one the computer) take turns marking an available cell in a 3 X 3 grid (a two dimensional array) with their respective tokens (either and X or an O). When one player has placed three tokens in a horizontal

  Algorithm design and development - the graduate designs and

algorithm design and development - the graduate designs and develops algorithms for problem solving and implements

  Declare a string variable named empty

Declare a string variable named empty, and initialize it to the empty string.

  What is object-oriented programming

What is object-oriented programming? What are the differences between a class and an object

  Programming languages for example pascal

Some programming languages for example Pascal have used the semi colon to seperate statements while java uses it to terminate the statements. which of them in your opinion is most natural and least likely to result in syntax errors? support your a..

  Description of routes and services

Write a method for finding a journey from one station to another using an algorithm that is specified below in this handout.

  Calculates the total at the end

Make a program that asks the user how much change they have and then calculates the total at the end.

  Task 1 create a new project in eclipsecreate a package

task 1 create a new project in eclipse.create a package called lsquopeople within this project. download the start up

  A uml activity diagram that illustrates how program works

Create a UML activity diagram that illustrates how your program works. Your diagram must include all the data items in your program.

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