Write the output from instrument class methods

Assignment Help Basic Computer Science
Reference no: EM13771931

Design and implement a stringed musical instrument class using the following guidelines

Data fields for your instrument should include number of strings, an array of string names representing string names (e.g. E,A,D,G), and boolean fields to determine if the instrument is tuned, and if the instrument is currently playing. You are welcome to add additional data fields if you like.

A constructor method that set the tuned and currently playing fields to false.

Other methods 1) to tune the instrument, 2) to start the instrument playing, and 3) to stop the instrument from playing.

Other methods as you see fit (Add at least one unique method).

Create Java classes for your instruments. Be sure that your code matches your design specifications and some minimal functionality is included. For example, if you called the violin.play() method, you should at least print that the violin is playing. Similar functionality should be supplied when you stop playing, tune or call any of your methods. For example:

public void playviolin() {

System.out.println("The violin is now playing.");

}

Write the output from your Instrument class methods to a text file that a user entered from the command line arguments (e.g. java Mynamep3tst myfilename.txt). This allows your program to accept filenames from the user via a command line argument.

Finally, create a Java test class that simulates using your instrument class. In your test class be you should at a minimum: a) Construct 10 instances of your instrument, b) tune your instruments, c) Start playing your instrument, d) Call your unique method, and e) Stop playing your instruments. (Hint: Arrays and Loops will make your job easier and result in more efficient code!)

Your programs should compile and run without errors.

Be sure to test your program carefully. Provide a list of comprehensive test cases used to validate your application and include these test cases in your word document. Similar to Project 1, your test data can be shown in a table that includes input data, expected output, actual output and pass/fail results from the test.

Reference no: EM13771931

Questions Cloud

Create simple java application that uses the string class : Create your own simple Java application that uses the String class and/or the StringBuffer class and at least 4 of the class methods. Show the code, demonstrate it works properly and describe what it is doing.
Analysis of individual performance in a team : Write a 3-5 page analysis of team dynamics in a team of which you have been a part. Incorporate what you have learned about your emotional intelligence skills into this paper, as well as other characteristics of individual behavior we have studied..
Write paper on media involvement in west memphis case : Write a four pages paper about the media involvement in West Memphis Three Case.
What is the heat capacity of the bomb calorimeter : What is the heat capacity of the bomb calorimeter excluding the water -  What is the heat capacity of the bomb calorimeter excluding the water?
Write the output from instrument class methods : Write the output from your Instrument class methods to a text file that a user entered from the command line arguments (e.g. java Mynamep3tst myfilename.txt). This allows your program to accept filenames from the user via a command line argument.
How would you collect them for evidence : What are 2 actions that can be taken pertaining to the crowd of onlookers that might help you identify the offender(s)? Explain. How would you collect them for evidence
Write a computer program that prompts user for two numbers : Write a computer program that prompts the user for two numbers, n for the number of items in the array to sort, and num_ifor a number of iterations
What is the correct formula of the salt formed : What is the correct formula of the salt formed in the neutralization reaction of hydrochloric acid with calcium hydroxide and Select the compound in which sulfur has its highest possible oxidation number.
Determine the time of death : There is a difference between a crime scene investigator and a coroner's investigator. There is also a difference between a coroner and a medical examiner. There are 3 ways to determine the time of death

Reviews

Write a Review

 

Basic Computer Science Questions & Answers

  How you would overcome these challenges

You are the CIO for Rapid Cargo, a shipping company specializing in delivering large items quickly - Show the issues that managing and implementing the technology architecture you would have and how you would overcome these challenges.

  Is this problem solvable or unsolvable prove

Assume that the network is a complete graph of n>2 participants. The termination and validity requirements are the same as explained in the class. However, the agreement requirement is weakened to say: "If any process decides 1 then there are at leas..

  Discuss why the user needs are important or stood out

Cite specific examples from readings. Include personal experience with the topic if appropriate

  List five addressing modes of the lc

What is an addressing mode? Name three places an instruction's operands might be located. List five addressing modes of the LC-2.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Analyze use of databases in business environment

Create the 2-3 page memorandum analyzing use of databases in the business environment. Include what database applications must be used: Microsoft Access, IBM DB2, Oracle, etc.

  Estimate maximum aggregate i-o transfer rate in system

Estimate the maximum aggregate I/O transfer rate in this system. Hint: Only one device at a time can be serviced on a selector channel.

  Utilize computer paper

Develop at least three areas you can utilize to compare/contrast them (pricing, performance, availability, etc.) and then select your tools and develop your paper. You must compare/contrast at least five computer forensics tools.

  Which vulnerability be evaluated for extra controls first

If organization has three information assets to evaluate for risk management as shown in accompanying data, which vulnerability must be evaluated for additional controls first? Which one must be evaluated last?

  A static method that takes an array of integers as parameter

Write a static method that takes an array of integers as a parameter and returns back an integer that is the sum of all of the integers in the array.

  A modem that uses qam-64 modulations.

My ADSL provider's twisted-pair lines provide a total bandwidth of 1.1M hertz and the provider provides me with a modem that uses QAM-64 modulations.

  Corporate agency policy on employee use of instant messaging

What specific questions should a corporate or government agency policy on "Employee use of Instant Messaging (IM) using corporate computers" address?

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