Java source code classes and objects, computer programming, Programming Languages

Design and implement a stringed musical instrument class using the following guidelines:
a. 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.
b. A constructor method that set the tuned and currently playing fields to false.
c. Other methods 1) to tune the instrument, 2) to start the instrument playing, and 3) to stop the instrument from playing.
d. Other methods as you see fit (Add at least one unique method).
2. Create a UML class diagram using a diagram tool (e.g. PPT, Visio) of your choice. Prepare the diagrams and place them in a word document along with a brief description of each of your classes.
3. 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.");
}
4. 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.
5. 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!)
Posted Date: 3/10/2012 8:19:58 PM | Location : United States







Related Discussions:- Java source code classes and objects, computer programming, Assignment Help, Ask Question on Java source code classes and objects, computer programming, Get Answer, Expert's Help, Java source code classes and objects, computer programming Discussions

Write discussion on Java source code classes and objects, computer programming
Your posts are moderated
Related Questions
Explain what is HTML language with an example? HTML is the HyperText Markup Language. HTML files are text files featuring semantically tagged elements. HTML filenames are suff

Define Call by value - Computer Programming? Functions are raise by writing their name and an appropriate list of arguments within parenthesis. Usually these arguments are in t

i(t)=(V/R) * (1-e^-(R/L)(t)) (a) Defi ne an anonymous function answerE that returns i(t) given input t. (b) The fi nal value for the current is 2 amps. Find a time tm when the curr

In combat simulation software, exploding land mines cause damage to military vehicles. In addition to the damage done to the vehicles themselves, we are interested in the number of

Write a program that takes names of 5 students in 2D Character Array and their GPAs in 1D array. Arrange the names in alphabetical order and display on screen along with GPA.

Vacation Envy - Travel and Photo Sharing Website Site Overview- Vacation Envy is a travel as well as photo-sharing site. Make your travel map, share photos and show off al

I need help I want to implement the Genetic Algorithm for Shortest path Kindly Help me I will be thankful to you

Short Arrays: Array = randi(10,1,randi(6,1,1)+4)-5 This command will generate an array which you should be able to evaluate by hand (and also have your code evaluate for te

You will soon receive in an email a personalized assignment that tells you the nature of the "Empirical Data" you are to produce with a Pascal program for HW3. HW3 is about generat

Each of the following two procedures defines a method for adding two positive integers inĀ  terms of the procedures inc, which increments its argument by 1, and dec, which decrement