Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions