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
Write an application that prompts a user for two integers and displays every integer between them. Display There are no integers
olga2289 [7]

Answer:

x = int(input("Enter an integer: "))

y = int(input("Enter another integer: "))

if x > y:

   for number in range(y+1, x):

       print(number, end=" ")

elif y > x:

   for number in range(x+1, y):

       print(number, end=" ")

else:

   print("There are no integers between {} and {}".format(x, y))

Explanation:

*The code is in Python.

Ask the user to enter the two integers, x and y

Since we want our program to run regardless of which entered value is larger, we need to compare the numbers to be able to create the loop that prints the numbers.

Check if x is greater than y. If it is, create a for loop that iterates from y+1 to x-1 and print the numbers

Otherwise, check if y is greater than x. If it is, create a for loop that iterates from x+1 to y-1 and print the numbers

If none of the previous part is executed, print that there are no integers between

4 0
3 years ago
Which of these agencies main goal is the promotion of consumer protection?Immersive Reader
sattari [20]

Answer:

FTC (Federal Trade Commission)

Explanation:

However, it is not just the one government body that works to ensure consumer protection. The FTC is certainly one, however, though the others are the Food and Drug Administration, Financial Protection Bureau and the US Department of Justice. And all these bodies together ensure that the rights of the consumer are protected, through enforcement of various acts, and each of them deals with a certain type of good.

6 0
3 years ago
Define a model or version that is used to test an idea is called a _______.
gulaghasi [49]
The answer is prototype
5 0
3 years ago
A queue processes elements in a _____ manner. <br> a. filo <br> b. lifo <br> c. lilo <br> d. fifo
sladkih [1.3K]

A queue processes elements in a <u> fifo</u> manner.

<h3>What is the rule that each stack and queue are understood by?</h3>

The rule used for a queue is to permanently remove the item that has been in the collection the most amount of time.

This policy is known as first-in-first-out or FIFO. The rule used for a stack is to always remove the item that has been in the collection the least amount of time.

<h3>What is queue how it is distinct from stack and how is it implemented?</h3>

The primary difference between Stack and Queue Data Structures is that Stack pursues LIFO while Queue follows FIFO data structure type. LIFO guides to Last In First Out. It means that when we put data in a Pile, it processes the last entry first. Conversely, FIFO guides to First In First Out

To learn more about FIFO,  refer

brainly.com/question/27952133

#SPJ4

3 0
2 years ago
What will the following segment of code output if 11 is entered at the keyboard? int number; cin &gt;&gt; number; if (number &gt
galina1969 [7]

Answer:

1. C++ is fun

Explanation:

Writing the code more clear:

int number;

cin >> number;

if (number > 0)

          cout << "C++";

else

          cout << "Soccer";

cout << " is ";

cout << "fun" << endl;

On the IF line, the conditional expression is evaluated TRUE (11 > 0), so the string "C++" is printed.

Then, the ELSE sentence is not executed since the expression has been already evaluated as TRUE.

Notice there are no additional brackets, so only the line cout << "Soccer"; is considered inside the ELSE.

The two remaining lines are executed always.

The final result is:

C++  is fun

5 0
3 years ago
Other questions:
  • Which individual of the following would be most likely to be directly concerned with web security?
    14·2 answers
  • To create a digital file from an old photo, I would use a _____.
    10·1 answer
  • You can access various sites on the WWW by using hyperlinks or by______. A. entering a key word for your search B. following dir
    12·2 answers
  • What does the Additional Clock tab do?
    11·1 answer
  • Because its radio waves can pass through walls or desktops,
    15·1 answer
  • After which stage in the information processing cycle can data be referred for future use?
    7·1 answer
  • Define an organizational unit in your own words.
    11·1 answer
  • Choose all the answers that apply.
    15·1 answer
  • Who made the first sandwich?
    5·2 answers
  • A large computer repair company with several branches around Texas, TexTech Inc. (TTi), is looking to expand their business into
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!