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
inn [45]
3 years ago
11

Where is the error in this code sequence?

Computers and Technology
1 answer:
Art [367]3 years ago
7 0

Answer:

There is an error in "String s=s1-s2 ";

Explanation:

In java programming, we can subtract subtract two strings variable with "-" operator.Java programming does not  support an overload of the '-' operator.In java, we can use only "+" operator to append two strings variable.There is no such method to subtract strings in java.Therefore in the given code String s=s1-s2 will give an "bad operand type" error because we can not subtract one string variable from the second string variable.

You might be interested in
You can install several printers on your machine, but at least one must be the _______ printer.
Digiron [165]
<span>You can install several printers on your machine, but at least one must be the default printer.
When you have several machines attached to your computer, it is important to designate one of them as the 'default' machines so as to avoid confusion within the system. If you fail to do this, you may create some problems, so be sure to choose a default one.</span>
3 0
3 years ago
TCP will guarantee that your packets will arrive at the destination, as long as the connection is still established. True False
puteri [66]

Answer: True

Explanation: TCP(Transmission control protocol) is the protocol that is responsible for making the connection between the two hosts and then  they can share the data between them.

TCP guarantees that the data or data packets that are being sent from the source will be delivered to the host  in the same way as it was sent from source port. This mechanism ensure that there will be no data manipulation in the order of the data. TCP also has a relation with the IP for the functioning.Thus the given statement is true.

3 0
3 years ago
What is the difference between Brainly.com and Brainly.in? Ive been wondering because im not signed in under Brainly.in.
german

Answer:

I think they are the same but I think that Brainly.com has more features.

Explanation:

7 0
2 years ago
Read 2 more answers
) Perform error checking for the data point entries. If any of the following errors occurs, output the appropriate error message
emmainna [20.7K]

Answer:

In Python:

entry = input("Sentence: ")

while True:

   if entry.count(",") == 0:

       print("Error: No comma in string")

       entry = input("Sentence: ")

   elif entry.count(",") > 1:

       print("Error: Too many comma in input")

       entry = input("Sentence: ")

   else:

       ind = entry.index(',')+1

       if entry[ind].isnumeric() == False:

           print("Comma not followed by an integer")

           entry = input("Sentence: ")

       else:

           break

print("Valid Input")

Explanation:

This prompts the user for a sentence

entry = input("Sentence: ")

The following loop is repeated until the user enters a valid entry

while True:

This is executed if the number of commas is 0

<em>    if entry.count(",") == 0:</em>

<em>        print("Error: No comma in string")</em>

<em>        entry = input("Sentence: ")</em>

This is executed if the number of commas is more than 1

<em>    elif entry.count(",") > 1:</em>

<em>        print("Error: Too many comma in input")</em>

<em>        entry = input("Sentence: ")</em>

This is executed if the number of commas is 1

   else:

This calculates the next index after the comma

       ind = entry.index(',')+1

This checks if the character after the comma is a number

       if entry[ind].isnumeric() == False:

If it is not a number, the print statement is executed

<em>            print("Comma not followed by an integer")</em>

<em>            entry = input("Sentence: ")</em>

If otherwise, the loop is exited

<em>        else:</em>

<em>            break</em>

This prints valid input, when the user enters a valid string

print("Valid Input")

Note that: entry = input("Sentence: ") <em>is used to get input</em>

4 0
3 years ago
Select the correct answer.
ipn [44]

Answer:

I'm guessing D? i hope its right

5 0
2 years ago
Read 2 more answers
Other questions:
  • This stores a piece of data and gives it a specific name
    7·1 answer
  • If a user has just added a simple triangle shape into a diagram, how can the triangle be adjusted? Check all that apply. by maki
    6·2 answers
  • What is the difference between primary storage,secondary storage and offline storage what type of storage can be
    6·2 answers
  • Find the word-length 2's complement representation of each of the following decimal numbers:a. 845b. 15000c. 100d. -923
    8·2 answers
  • You have three users who travel to four branch offices often and need to log on to the RODCs at these offices. The branch office
    12·1 answer
  • س2) اکتب خوارزميه لحل المعادلة الرياضيه الاتيه
    9·1 answer
  • Consumer consequences for illegally downloading software
    6·1 answer
  • What is the suffix of hollow?
    7·1 answer
  • Which of the following statements best explains how multitasking works in the human mind?
    11·1 answer
  • Who designed the apple i computer in 1976?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!