1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sattari [20]
3 years ago
8

Write a Java test program, named TestGuitar, to create 3different 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. Forexample for a Guitarwith 7strings,length of 30.2,manufactured by Fender with a color of Black, the output may look similar to this:
Computers and Technology
1 answer:
alina1380 [7]3 years ago
4 0

Answer:

Explanation:

//Guitar.java

import java.awt.Color;

import java.lang.reflect.Field;

import java.util.Random;

public class Guitar

     /**

     * these two fields are used to generate random note and duration

     */

     static char[] validNotes = 'A', 'B', 'C', 'D', 'E', 'F', 'G' ;

     static double[] validDuration = 0.25, 0.5, 1, 2, 4 ;

     /**

     * basic guitar attributes

     */

     private int numStrings;

     private double guitarLength;

     private String guitarManufacturer;

     private Color guitarColor;

     public Guitar()

           /**

           * default constructor

           */

           numStrings = 6;

           guitarLength = 28.2;

           guitarManufacturer = Gibson;

           guitarColor = Color.RED;

     

     public Guitar(int numStrings, double guitarLength,

                 String guitarManufacturer, Color guitarColor)

           /**

           * parameterized constructor

           */

           this.numStrings = numStrings;

           this.guitarLength = guitarLength;

           this.guitarManufacturer = guitarManufacturer;

           this.guitarColor = guitarColor;

     

     /**

     * required getters and setters

     */

     public static char[] getValidNotes()

           return validNotes;

     public static void setValidNotes(char[] validNotes)

           Guitar.validNotes = validNotes;      

     public static double[] getValidDuration()

           return validDuration;

     public

You might be interested in
Mike wants to capture some images of his application as it appears on the screen. In order to do this, Mike needs to know how to
Stells [14]
D is the best answer
I hope it’s work
5 0
3 years ago
Which expression correctly determines that String s1 comes before String s2 in lexicographical order
Assoli18 [71]

Options :

A.) s1 < s2

B.) s1 <= s2

C.) s1.compareTo(s2) == −1

D.) s2.compareTo(s1) < 0

E.) s1.compareTo(s2) < 0

Answer: E.) s1.compareTo(s2) < 0

Explanation: Lexicographical ordering simply means the arrangement of strings based on the how the alphabets or letters of the strings appear. It could also be explained as the dictionary ordering principle of words based on the arrangement of the alphabets. In making lexicographical comparison between strings, the compareTo () method may be employed using the format below.

If first string = s1 ; second string = s2

To compare s1 with s2, the format is ;

s1.compareTo(s2) ;

If s1 comes first, that is, before s2, the method returns a negative value, that is a value less than 0 '< 0', which is the case in the question above.

If s2 comes first, that is, before s1, the method returns a positive value, that is a value greater than 0 '> 0'.

If both are s1 and s2 are the same, the output will be 0.

8 0
3 years ago
The initial step of the five-step problem-solving model is to: A. Explore alternatives B. Clarify values. C. Develop an approach
Alik [6]

Answer:

D. Identify the problem.

Explanation:

         

The five steps are -

  • Identify the problem
  • Understanding the problem
  • Select any alternative way to solve a problem
  • Select the best way to solve a problem from the list of alternative solutions.
  • List the instructions to solve the problem using the selected solution and evaluate the solution .

Identify the problem - This is the first steps towards solving a given problem. One must properly comprehend what exactly the challenge is.

8 0
3 years ago
Jim maintains attendance records for his employees for the year row B includes the dates of attendance and columns A includes th
never [62]

lock:row\A

set:row\b

this is the correct answer

3 0
4 years ago
why is it that everytime i ask a question (with brainly plus) it says there arnt any matches for your search. are the servers do
fiasKO [112]
That happens to me to
6 0
3 years ago
Other questions:
  • Write the definition of a function named quadratic that receives three double parameters a, b, c. If the value of a is 0 then th
    12·1 answer
  • When solving for K, when cell potential is known, what is one of the first steps to follow?
    8·1 answer
  • Michael Holliday is a business systems analyst who is working on a feasibility study for a new​ e-911 system for the city of Mem
    6·1 answer
  • During data declaration, a name is binded to a memory location, what else can be identify as part of this process?
    12·1 answer
  • A group of developers for a startup company store their source code and binary files on a shared open-source repository platform
    14·1 answer
  • Write a function called prod_all that takes any number of arguments and returns their sum. Test the function by using these two
    10·1 answer
  • I will give Brainliest and Extra points for correct answers!!!
    13·2 answers
  • SOMEONE PLEASE HELP ME I REPOSTED THIS 3 time and no ONE HAD HELPED ME
    15·1 answer
  • The different generation of computer explain in breif?​
    7·2 answers
  • HELP THIS IS SO DIFFICULT
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!