Given main() and the Instrument class, define a derived class, StringInstrument, for string instruments.
Ex. If the input is:
Drums Zildjian 2015 2500 Guitar Gibson 2002 1200 6 19
the output is:
Instrument Information: Name: Drums Manufacturer: Zildjian Year built: 2015 Cost: 2500 Instrument Information: Name: Guitar Manufacturer: Gibson Year built: 2002 Cost: 1200 Number of strings: 6 Number of frets: 19

Answers

Answer 1

Answer:

Explanation:

The following derived class called StringInstrument extends the Instrument class and creates the necessary private variables for number of Strings and number of Frets. Then it creates getter and setter methods for each of the variables. This allows them to be called within the main method that has already been created and output the exact sample output as seen in the question.

class StringInstrument extends Instrument {

   private  int numStrings, numFrets;

   public int getNumOfStrings() {

       return numStrings;

   }

   public void setNumOfStrings(int numStrings) {

       this.numStrings = numStrings;

   }

   public int getNumOfFrets() {

       return numFrets;

   }

   public void setNumOfFrets(int numFrets) {

       this.numFrets = numFrets;

   }

}

Given Main() And The Instrument Class, Define A Derived Class, StringInstrument, For String Instruments.Ex.

Related Questions

Using a tag, set the color to green for all tags.

Answers

Answer:

<style>

p {

background-color: rgb(255, 0, 0);

}

h1 {

background-color: rgb(0, 255, 0);

}

ol {

background-color: rgb(97,51,47);

}

</style>

Explanation:

Put this at the top of your code. It should target the paragraph tag, the header h1 tag, and the Ordered List (OL) tag individually and set their background colors respectively.

It's been a while since I've done CSS so you might have to tweak the syntax a bit, but it should look something like that.

When identifying who will send a presentation, what are the two types of audiences?

Answers

Answer:

Explanation:Demographic audience analysis focuses on group memberships of audience members. Another element of audience is psychographic information, which focuses on audience attitudes, beliefs, and values. Situational analysis of the occasion, physical setting, and other factors are also critical to effective audience analysis.

You have been given an encrypted copy of the Final exam study guide here, but how do you decrypt and read it???

Along with the encrypted copy, some mysterious person has also given you the following documents:

helloworld.txt -- Maybe this file decrypts to say "Hello world!". Hmmm.

hints.txt -- Seems important.

In a file called pa11.py write a method called decode(inputfile,outputfile). Decode should take two parameters - both of which are strings. The first should be the name of an encoded file (either helloworld.txt or superdupertopsecretstudyguide.txt or yet another file that I might use to test your code). The second should be the name of a file that you will use as an output file. For example:

decode("superDuperTopSecretStudyGuide.txt" , "translatedguide.txt")

Your method should read in the contents of the inputfile and, using the scheme described in the hints.txt file above, decode the hidden message, writing to the outputfile as it goes (or all at once when it is done depending on what you decide to use).

Hint: The penny math lecture is here.

Another hint: Don't forget about while loops...

Mac hint: use encoding="utf-8" in your file open functions, like this:

Mac hint: use encoding="ascii" in your file open functions, like this:

fin = open(input_file,"r",encoding="ascii")

Answers

Answer:

You use a decoder

Explanation:

You can find one on an internet browser

Consider the following method:
public static String joinTogether(int num, String[] arr)
{
String result = "";
for (String x : arr)
{
result = result + x.substring(0, num);
}
return result;
}

The following code appears in another method in the same class:
String[] words = {"dragon", "chicken", "gorilla"};
int number = 4;
System.out.println(joinTogether(number, words));

What is printed when the code above is executed?
a. dragonchickengorilla
b. drachigor
c. dragchicgori
d. dragochickgoril
e. There is an error in the program, it does not run

Answers

Answer: b.

Explanation:

How SPARQL 1.1 has advantage over SPARQL 1.0??​

Answers

SPARQL 1.0 became an official W3C Recommendation on 15 January 2008. On 26 March 2013, the SPARQL Working Group has produced a new W3C Recommendation SPARQL 1.1 that introduces more features to 2008 version. SPARQL is emerging as the de facto RDF query language. Prior to SPARQL, there were some other popular RDF query languages, such as RQL, SeRQL, TRIPLE, RDQL, and so on. The comprehensive...

Write a class called MonetaryCoin that is derived from the Coin class presented in Chapter 5 (the source code for Chapter 5 examples is available via Moodle). [6 pts] Store one integer and one float in the MonetaryCoin that represent its value and weight in grams, respectively. Add a third variable of your choice (related to a coin, of course) and use self-descriptive variable names for all three variables. Pass the values to the constructor in MonetaryCoin and save them to your variables.

Answers

Answer:

Explanation:

The following Java code creates the MonetaryCoin class that extends the Coin class. It then creates three variables representing the MonetaryCoin object which are its value, weight, and coinYear. These are all passed as arguments to the constructor and saved as instance variables.

public class MonetaryCoin extends Coin {

   

   int value;

   float weight;

   int coinYear;

   

   public void MonetaryCoin(int value, float weight, int coinYear) {

       this.value = value;

       this.weight = weight;

       this.coinYear = coinYear;

   }

}

True or false you cannot get a computer virus is you instal antivirus

Answers

Answer: F

Explanation: There are many ways hackers can get into your computer, and many ways can bypass an antivirus so it is False

This is true because if you instal antivirus is no way the computer get virus then

Please Fix This For Me


print ("Please enter a number between 1 and 100")
n = input

if = n < 1 and n > 100:

if = (n // 2 == 0):
print (n, "is even")

if = (n // 3 == 0):
print (n, "is odd")

else:
print("You have not entered a number between 1 and 100.")

Answers

Answer:

The correction is as follows:

n = int(input("Please [tex]enter\ a[/tex] [tex]number\ between\ 1[/tex] and 100: "))

if n < 1 or n > 100:

   print("You [tex]have\ not[/tex] entered a [tex]number\ between\ 1[/tex] and 100.")

elif n % 2 == 0:

   print (n, "is even")

else:

   print (n, "is odd")

Explanation:

See attachment for explanation

how many stages needed to have powerful amplifier?​

Answers

Power amplifier stages in a real circuit. Circuit diagram of a three stage practical audio power amplifier is shown in the figure below. Small signal transistor Q1 and its associated components form the voltage amplification stage.

Answer:

Generally you should pick an amplifier that can deliver power equal to twice the speaker's program/continuous power rating. This means that a speaker with a “nominal impedance” of 8 ohms and a program rating of 350 watts will require an amplifier that can produce 700 watts into an 8 ohm load.

Which of the following is not part of the four ways you can avoid problems with email communication?
a.
Be brief.
b.
Proofread your message.
C.
Reply right away after you get an email.
d.
Seek other ways to relay your message

Answers

Answer:

d is the correct answer for this problem

Which element adjusts the space around the data in each cell of a table? adjusts the space around the data in each cell of a table.

Answers

Answer:

Increase/decrease indentation

Explanation:

Answer:

(Cellpadding) is actually the correct answer.

Explanation:

Cellpadding and cellspacing are two important features of an HTML table. Cellpadding sets the space around the data in each cell. Cellspacing sets the space around each cell in the table.

Do exercises as follows:

a. Enter a whole number from keyboard, a while loop should calculate a sum of all numbers from one to that number that you entered
b. Enter a numeric score - grade of a test, your program should print a corresponding letter grade that matches the score.

For example, if you enter 89.3, the program should display "B", and if you enter 95.7, then the program displays "A"

Answers

Answer:

Explanation:

The following Java program asks the user for a number to be entered it and uses a while loop to sum up all the numbers from 1 to that one and print it to the console. Then it asks the user for a grade number and prints out the corresponding letter grade for that number.

file = open('text.txt', 'r')

total_rainfall = 0

for line in file:

   line = line.replace('\n', '')

   info = line.split(' ')

   info = [i for i in info if i != '']

   print(info[0] + " will have a total of " + info[1] + " inches of rainfall.")

   total_rainfall += int(info[1])

average = total_rainfall / 3

print("Average Rainfall will be " + str(average) + " inches")

63. Name the 4 main lights & and their primary purpose.

Answers

I don’t know this !!

what can a user modify on a business card using the Edit Business card in the dialog box?​

Answers

Answer: layout,image,font,background color,
Other Questions
At a particular fast food restaurant, tacos cost $1.29 andburritos cost $2.19. Michael spent a total of $42.93 at therestaurant to buy food for a party. If he purchased half asmany burritos as tacos, how many tacos did he buy? 23*3 (look at pic)3 in 23 is an exponent in a different game, the probability of guessing which of 5 boxes contains a tennis ball is 1/5. about how many winners would be expected if 60 contestants play the game? .help please thank you which of the following could be factored by grouping?a. wy+wz+xy-xz b. wy+yz-wx+yz c. wy+wz+xy+xz d. wx+wz-wy+wv Who was the Greek God that was the ruler of all gods and humanity the lengths of two sides of a triangle are 8in. and 13in. find the range of possible lengths for the third side How many triangles are there help please how did they stop the rasism for jackie robinson How does the shape of the red blood allow diffusion to occur efficiently Cassandra earns $12.98 an hour working at Key Food. How much money will sheearn this month, if she works 36.7 hours? Round the amount of time to thenearest hundredth. * Lewis was raised by his mother and father, but when they divorced he went to live with his father. When his father got re-married, Lewis was happy to live with his father, his stepmother, and his new step-sister. He is now living in a stepfamily, which is also called a(n) ________ family. 14 points PLEASE help Im on a time crunch right now:( Please help thanks!! I WILL MARK YOU AS BRAINLIEST IF YOU ARE CORRECT! THIS QUESTION IS SUPER EASY! Look at the image below. I need help doing my equation clock fully done or I report the first one done get brainlyest please help if you know the answer. IF you could also explain it that would be very helpful but you don't need to as long as you know the answer 13. Using figure 1, angles 5 and 6 form a linear pair, If mz6=95", find m25.a. 5b. 85"c. 90d.95"14. In figure 1, 25 and 28 are vertical angles. If m2s 2x + 45 and m28= 7x - 15What is the value of x ?a.6b. 12c.9d. 21paki answer po plss More than __________ people have been killed since 1990 in crashes due to aggressive driving. The graph of f(x)=cos(x) is transformed into a new function, g(x), by stretching it vertically by a factor of 3 and shifting it 2 units up. What is the equation of the new function g(x)? Enter your answer in the box g(x)=