Using your musicalinstrument class

Assignment Help JAVA Programming
Reference no: EM13168168

  1. Create a class named MusicalInstrument and its four subclasses named Woodwind, Brass, String and Percussion.
  2. The MusicalInstrument has a name, isPlaying, and isTuned data fields. It also has methods for setting and getting the values of each of the fields along with a method to display how the instrument is played. A constructor that sets the isTuned and isPlaying fields to false is also included in the MusicalInstrument class. You are welcome to add additional data fields and methods if you like.
  3. Finally, create a Java test class that simulates using your MusicalInstrument class.  In your test class you should at a minimum: a) Construct 4 instances of your instrument, b) tune your instruments, c) print the name of your instrument d) print how you play your instrument  
  4. In order to exercise polymorphism, please declare in the test class an array with 4 elements of type MusicalInstrument, and populate it with objects of each of the subclasses.

Reference no: EM13168168

Questions Cloud

The chief financial officer : The chief financial officer (CFO) of NCWR keeps a huge number of reports, spreadsheets, and other critical financial information on his computer, which runs Windows 7
Long-distance communication in a wan infrastructure : How can cables like UTP and coaxial cable be used for long-distance communication in a WAN infrastructure? Where are these cables used most often?
Catch clauses are listed is important : write a program that can be used to demonstrate that the order in which catch clauses are listed is important
Program that will calculate the heat transfer of a substance : write a program that will calculate the heat transfer of a substance (water) given three different shapes. The user has to be able to input the type of shape, so that the computer can calculate area, and plug it back in to the equation for heat trans..
Using your musicalinstrument class : Finally, create a Java test class that simulates using your MusicalInstrument class.  In your test class you should at a minimum: a) Construct 4 instances of your instrument, b) tune your instruments, c) print the name of your instrument d) print ..
Dubbing was coined as a term of copying : Dubbing was coined as a term of copying media in the 1980's for all mediums. What term was a major issue during the process of continously dubbing media? Digitization cured this issue.
Write a java program that uses the elapsed time : Write a Java program that uses the elapsed time for an event in second and then outputs the elapsed time in hours, minutes and seconds. (For example, if the desired time is 9630 seconds, then the output is 2: 40: 30)
Matching program that takes input from a text file : need to make a string matching program that takes input from a text file and outputs that match (if there is one) asked from the user. i have done this part , the only problem is that , with the output match , i also need to print some words before a..
Called cbankaccount : Create a base class, called CBankAccount, and two additional classes (each derived from CBankAccount), called CSavingsAccount and CCheckingAccount.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create a web application for sheridan restaurant

Create a web application for Sheridan Restaurant Reviews that contains the following functionality - Display a table of all restaurants based on the city entered by the user

  What is server-side and client-side scripting?

1. What is Server-side and Client-side scripting? Explain the differences between server-side and client - side scripting languages. Please provide 3 advantages and disadvantages of each. Please provide applicable references in APA style

  Program that allows the user to enter the last names

Write a program that allows the user to enter the last names of 5 candidates in a college election and the votes received by each candidate. The program should then output each candidates name, the votes reveived by that candidate

  Evaluate the rtas resource requirements

Design and implement a set of classes and interfaces and use them to evaluate the RTA's resource requirements.

  Java program to decide whether integer is perfect number

For example, 6 is a perfect number because 6 = 1 + 2 + 3. Write a Java program that decides whether integer is a perfect number.

  Distance traveled modification

Distance Traveled Modification

  String that contains at least five letters

Write an application that prompts the user for a String that contains at least five letters and at least five digits. Continuously reprompt the user until a valid String is entered. Display a message indicating whether the user was successful or did ..

  Use either an array or a linked list

Use either an Array or a Linked List as an underlying data structure. Of course you need to create class Array or class LinedList in order to implement the methods like mergeSort(), merge(), etc

  Java program which handles events from different sources

how to setup a program to respond to events from any one of these sources. How do you create the necessary listener class? How do you associate the listener object with the event source?

  Develop java code to compute monthly rent for housing units

Develop a java code that computes monthly rent for 3 housing units namely Bungalows,Apartments and hostels. All housing units have got size,color and monthly rental rate.

  Implement the application using a singly linked list

Implement the following application using a singly linked list. This application accepts from console and stores a list of 10 names of your friends in the singly linked list

  Create a computer class

Create a computer class and assume computers have the following fields: String manufacture, double price, int year

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