Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Business Management Expert

Design a Java class named Guitar that contains:

  • A private int data field named numStrings that defines the number of strings on the guitar. The default value should be 6. 
  • A private double data field named guitarLength that defines the length of the guitar in inches. The default value should be 28.2 
  • A private String data field named guitarManufacturer that defines the manufacturer of the guitar. The default value should be "Gibson". 
  • A private Color data field named guitarColor that defines the color of the guitar. The default value should be Color.Red. 
  • A no argument constructor that creates a Guitar using the default number of strings, length, manufacturer and color. 
  • A constructor that creates a Guitar using a specified number of strings, length, manufacturer and color. 

Getter methods for all data fields. 

A playGuitar() method that returns a string representation of 16 randomly selected musical notes of random duration. For example, the first part of the string returned might look like this: [A(2), G(3), B(0.5), C(1), C(1), D(0.25), ...]. You can assume one octave in the key of C where valid notes include A, B, C, D, E, F and G and duration values are .25, .5, 1, 2, and 4 representing sixteenth notes, eighth notes, quarter notes, half notes and whole notes, respectively. 

  • A toString() method that displays the number of strings, length, manufacturer and color in String format 

Be sure your code compiles. 

Design a Java test program, named TestGuitar, to create 3 different Guitars representing each representing a unique test case and call each all of the getter methods along with the toString and playGuitar() methods and document the output. For example for a Guitar with 7 strings, length of 30.2, manufactured by Fender with a color of Black, the output may look similar to this: 

***Output*** toString(): (numStrings=7, Length=30.2, manufacturer=Fender, color=Black) getNumStrings(): 7 getGuitarLength(): 30.2 getGuitarManufacturer(): Fender getGuitarColor(): Black playGuitar(): [A(2), G(3), B(0.5), C(1), C(1), D(0.25), E(2), F(2), G(0.25), C(4), C(1), F(0.25),A(1), C(2), D(4),C(4)]

Business Management, Management Studies

  • Category:- Business Management
  • Reference No.:- M92791083
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Business Management

What is marketing discipline what is most peoples

What is marketing discipline? What is most people's perception of marketing discipline? Name an organization that has done a great job marketing. What did they do to make you feel this way?

What is the rationale for developing an annual fund

What is the rationale for developing an annual fund campaign when it would be less expensive for the organization to have few large donors rather than many small donors? Please describe the reason for annual fund campaig ...

What does research show regarding coaching relationships

What does research show regarding coaching relationships and what characteristics are associated with the best coaches?

Briefly describe a how personality develops over time b the

Briefly describe: (a) how personality develops over time, (b) the degree to which it becomes stable and when, and (c) general shifts that occur for most people moving into adulthood.

What impact if any does social media or conventional media

What impact, if any, does social media or conventional media have on threat? How big or small is this threat? What are the differences between social media and traditional media when it comes to threats?

Tactical operational exercises incorporate determination

Tactical operational exercises incorporate determination making in a management model of a business. What aspect are not covered by the tactical operations?

Time to go back to the beginning continuednow you have

Time to go back to the beginning... Continued... Now, you have thought extensively about a pencil, and written a discussion post.  Considering this,  What is technology? What is the essence of technology? Where does tech ...

Please response to a discussion post below from a

Please response to a discussion post below from a classmate. The three concepts or ideas I have gathered from my time in class are the basic principles of servant leadership, leadership and culture in military operations ...

Identify stakeholder training requirements and needs from a

Identify stakeholder training requirements and needs from a knowledge system requires research. Give examples of methods you have used, or would consider using in the future, to assess client learning needs.

Describe five changes in the vaiables that will cause

Describe five changes in the vaiables that will cause demand for a product to increase, shifting the demand curve to the right?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As