Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering 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: 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92792860
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Systems analysis projectpersonal trainer inc owns and

Systems analysis project Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an international expansion by opening a new "superce ...

Nfs allows the file system on one linux computer to be

NFS allows the file system on one Linux computer to be accessed over a network connection by another Linux system. Discuss the security vulnerabilities of NFS in networked Linux systems, and possible mitigation solutions ...

Riditna paper withdraws river water for use in its paper

Riditna Paper withdraws river water for use in its paper mill, and returns it, along with waste effluent, back into the river. (Effluent is a co-product of Riditna's paper, such that production of each ream of paper gene ...

Sql for databasebuild a query of all students on athletic

Sql for database Build a query of all students on athletic scholarship. Additionally, produce a report with descriptive report and column headings. Be sure there is enough data to prove the selection and sort worked as r ...

Assignment 2 windows 8 upgradeby the due date assigned

Assignment 2: Windows 8 Upgrade By the due date assigned, submit your assignment to the Submissions Area. Scenario: You are a consultant for a company that is using Windows 7 as their operating system and are considering ...

Can someone help me identify how intrustion detection

Can someone help me identify how Intrustion detection system and intrusion prevent system can help protect confidentiality, integrity and availability

Assume that the group has a portfolio of 6 stocks there is

Assume that the group has a portfolio of 6 stocks. There is 30% chance that any one of these stocks will increase in value. Find the probability that four of the six stocks increases in value.

Discuss the importance of metadata and some of the various

Discuss the importance of metadata and some of the various ways (Microsoft) SQL Server allows you to expose that information. References welcomed to learn where to find obscure IT information (books, articles, websites)

Please tell me about planning and installing a wireless

Please tell me about Planning and Installing a Wireless Network

Question what would be the impact of predictive modeling on

Question: What would be the impact of predictive modeling on healthcare and medicine? Can predictive modeling replace managerial or medical personnel? 500 word The response must be typed, single spaced, must be in times ...

  • 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