Before attempting this project, be sure you have completed all of the reading assignments, hands-on labs,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Before attempting this project, be sure you have completed all of the reading assignments, hands-on labs, discussions, and assignments to date. 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. Write 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)] Document your test cases in the form of table with columns indicating the input values, expected output, actual output and if the test case passed or failed. This table should contain 4 columns with 1 appropriate labels and a row for each test case. An example template is shown below. Note that the actual output should be the actual results you receive when running your program and applying the input for the test record. Keep in mind, for three guitars, you will have three different output results. Also, note there is no requirement to actually play the notes of the guitar. The notes are just a string representation. Example test cases: Input Expected Output Actual Output Pass ? Constructor: ** Output ** ** Output ** Yes numstrings-7 Example test cases: Input Expected Output Actual Output Pass ? Constructor: ** 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)] ** Output ** tostring () : (numStrings=7, Length=30.2, manufacturer=Fender, Yes numstrings=7 guitarLength=30.2 Manufacturer=Fende Color=Black 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)] Test case 2 here Test case 3 here The google recommended Java style guide, provided as link in the week 2 content, should be used to format and document your code. Specifically, the following style guide attributes should be addressed: Header comments include filename, author, date and brief purpose of the program. In-line comments used to describe major functionality of the code. Meaningful variable names and prompts applied. Class names are written in UpperCamelCase. Variable names are written in lowerCamelCase. Constant names are in written in All Capitals. Braces use K&R style. Submission requirements Deliverables include all Java files (.java) and a single word (or PDF) document. The Java files should be named appropriately for your applications. The word (or PDF) document should include screen captures showing the successful compiling and running of each of the test cases. Each screen capture should be 2 properly labeled clearly indicated what the screen capture represents. The test cases table should be included in your word or PDF document and properly labeled as well. Submit your files to the Homework 2 assignment area no later than the due date listed in your LEO classroom. You should include your name and HW2 in your word (or PDF) file submitted (e.g. firstnamelastnamehw2.docx or firstnamelastnamehw2.pdf) Grading Rubric: The following grading rubric will be used to determine your grade: Attribute Meets Guitar Class 10 points A private int data field named numStrings that defines the number of strings on the guitar was included. The default value was 6. (0.5 point) A private double data field named guitarLength that defines the Before attempting this project, be sure you have completed all of the reading assignments, hands-on labs, discussions, and assignments to date. 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. Write 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)] Document your test cases in the form of table with columns indicating the input values, expected output, actual output and if the test case passed or failed. This table should contain 4 columns with 1 appropriate labels and a row for each test case. An example template is shown below. Note that the actual output should be the actual results you receive when running your program and applying the input for the test record. Keep in mind, for three guitars, you will have three different output results. Also, note there is no requirement to actually play the notes of the guitar. The notes are just a string representation. Example test cases: Input Expected Output Actual Output Pass ? Constructor: ** Output ** ** Output ** Yes numstrings-7 Example test cases: Input Expected Output Actual Output Pass ? Constructor: ** 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)] ** Output ** tostring () : (numStrings=7, Length=30.2, manufacturer=Fender, Yes numstrings=7 guitarLength=30.2 Manufacturer=Fende Color=Black 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)] Test case 2 here Test case 3 here The google recommended Java style guide, provided as link in the week 2 content, should be used to format and document your code. Specifically, the following style guide attributes should be addressed: Header comments include filename, author, date and brief purpose of the program. In-line comments used to describe major functionality of the code. Meaningful variable names and prompts applied. Class names are written in UpperCamelCase. Variable names are written in lowerCamelCase. Constant names are in written in All Capitals. Braces use K&R style. Submission requirements Deliverables include all Java files (.java) and a single word (or PDF) document. The Java files should be named appropriately for your applications. The word (or PDF) document should include screen captures showing the successful compiling and running of each of the test cases. Each screen capture should be 2 properly labeled clearly indicated what the screen capture represents. The test cases table should be included in your word or PDF document and properly labeled as well. Submit your files to the Homework 2 assignment area no later than the due date listed in your LEO classroom. You should include your name and HW2 in your word (or PDF) file submitted (e.g. firstnamelastnamehw2.docx or firstnamelastnamehw2.pdf) Grading Rubric: The following grading rubric will be used to determine your grade: Attribute Meets Guitar Class 10 points A private int data field named numStrings that defines the number of strings on the guitar was included. The default value was 6. (0.5 point) A private double data field named guitarLength that defines the
Expert Answer:
Answer rating: 100% (QA)
Consider the automobile industry BMW does not manufacture all parts for its new type of automobile Different manufacturers supply various components wheels doors seats brakes sparks etc This model kee... View the full answer
Related Book For
Posted Date:
Students also viewed these accounting questions
-
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...
-
The Reflective Paper should demonstrate understanding of the reading assignments as well as the implications of new knowledge. The eight-page paper should integrate readings and class discussions...
-
Review Conceptual Example 2 before attempting this problem. Two slits are 0.158 mm apart. A mixture of red light (wavelength = 665 nm) and yellow-green light (wavelength = 565 nm) falls on the slits....
-
Create a Stored Procedure: Stored procedures allow you to make changes to the database structure and manage performance without needing to rewrite applications or deploy application updates. In this...
-
If you were economic adviser to a country that was following your advice about trade restrictions and that country fell into a recession, would you change your advice? Why, or why not?
-
An Oceanographic Tracer Nuclear weapons tests in the 1950 and 1960s released significant amounts of radioactive tritium (31H, half-life 12.3 years) into the atmosphere. The tritium atoms were quickly...
-
Consider the following cash flow profile and assume MARR is 10 percent/year. a. Determine the ERR for this project. b. Is this project economically attractive? EOY 0 2 3 4 5 6 NCF -$100 $15 $15 $15...
-
Presented below is the ledger for Sparks Co. Instructions (a) Reproduce the journal entries for the transactions that occurred on October 1, 10, and 20, and provide explanations for each. (b)...
-
Identify and analyze at least two considerations to ensure effective transaction transparency of Centralized database management systems and Distributed Database management systems. Identify...
-
Jackson et al. (1987) compared the precision of systematic and stratified sampling for estimating the average concentration of lead and copper in the soil. The 1-km2 area was divided into 100-m...
-
How many air molecules are in a 4.053.663.05 m3 room? Assume atmospheric pressure of 1.00 bar, a room temperature of 20.0 C, and ideal behavior? Express your answer numerically in litres.
-
The JMSB merch store would like to offer new T-Shirts. The supplier of the shirts writes in their offer: "We calculate with direct materials for each shirt of $4 and direct labor of $8. We also add a...
-
A loan is repaid by 10 annual payments at the end of each year. The first five payments are $2000 each and the last five payments are $3000 each. The effective rate of interest is i=0.06. Find the...
-
Mako Industries has annual credit sales of $2,000,000. Current expenses for the collection department are $50,000, bad-debt losses are 1.00%, and the DSO is 25 days. The firm is considering easing...
-
A loan of $100,000 is repaid with monthly payments of $1000 at the end of each month, and a smaller final payment one month after the last regular payment, at a nominal interest rate of (12)=0.06....
-
Using the information given here, what is the price-earnings ratio for DEF Company? Number of shares outstanding = 60,000 Price per share = $30 Book value per share = $10 O After-tax income =...
-
A 4.00 cm object is placed 30.0 cm from a diverging lens that has a focal length of -15.0 cm. (a) Determine the approximate distance between the object and the image. (b) What is the magnification of...
-
Eleni Cabinet Company sold 2,200 cabinets during 2011 at $160 per cabinet. Its beginning inventory on January 1 was 130 cabinets at $56. Purchases made during the year were as follows: February . 225...
-
An unknown nucleus contains 70 neutrons and has twice the volume of the nickel 60 28 Ni nucleus. Identify the unknown nucleus in the form A Z X. Use the periodic table on the inside of the back cover...
-
A snow maker at a resort pumps 130 kg of lake water per minute and sprays it into the air above a ski run. The water droplets freeze in the air and fall to the ground, forming a layer of snow. If all...
-
Two capacitors are connected to a battery. The battery voltage is V = 60.0 V, and the capacitances are C1 = 2.00 F and C2 = 4.00 F. Determine the total energy stored by the two capacitors when they...
-
Describe the issues that you considered in each of these facets when you made a recent important purchase.
-
The area of a rectangle is calculated according to the following formula: Design a function that accepts a rectangles width and length as arguments and returns the rectangles area. Use the function...
-
Design a program that gives simple math quizzes. The program should display two random numbers that are to be added, such as: The program should allow the student to enter the answer. If the answer...
Study smarter with the SolutionInn App