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
julia-pushkina [17]
3 years ago
5

Consider this data sequence: "fish bird reptile reptile bird bird bird mammal fish". let's define a singleton to be a data eleme

nt that is not repeated immediately before or after itself in the sequence. so, here there are four singletons (the first appearance of "fish", the first appearance of "bird", "mammal", and the second appearance of "fish"). write some code that uses a loop to read a sequence of words, terminated by the "xxxxx". the code assigns to the variable n the number of singletons that were read. (for example in the above data sequence it would assign 4 to n. assume that n has already been declared . but not initialized . assume that there will be at least one word before the terminating "xxxxx".
Computers and Technology
1 answer:
Ierofanga [76]3 years ago
5 0
N = 0

string temp;
if wordset[0] != wordset[1] then {
    n = n + 1
}
temp = wordset[0]
for i = 1 to wordset.length - 2 do {
    if wordset[i] != temp AND wordset[i] != wordset[i + 1] then {
        n = n + 1
    }
    temp = wordset[i]
 
} 

}
You might be interested in
Keisha wants to change the font color on the 1st and 3rd bullet items on slide 6 of her allied health presentation. what is the
Mice21 [21]
Is to tie them up together with a
7 0
4 years ago
Computer-aided design software is used by ________.
koban [17]

Answer:

by Architects?

Explanation:

not sure

6 0
3 years ago
Explain what an IM is, and what is the technology shown in the accompanying figure
sergiy2304 [10]

Answer: Instant Message

Explanation:

7 0
3 years ago
Read 2 more answers
9
Natasha_Volkova [10]

Answer:

I'm sorry the answer is really difficult to understand, could you explain?

Explanation:

8 0
3 years ago
Write a program that asks the user for three names, then prints the names in reverse order. Sample Run: Please enter three names
Sauron [17]

Solution:

Since no language was specified, this will be written in Python.

n1, n2, n3 = input ("Enter three names: ").split()

print(n3)

print(n2)

print(n1)

Cheers.

4 0
4 years ago
Other questions:
  • Which of the following is an extension of the fill pattern Sunday,Tuesday?
    10·2 answers
  • Should i buy the Samsung s10+ or wait for s11 or any other phones you guys suggest?
    6·2 answers
  • To view the results of a saved query, right-click the query in the Navigation Pane and click ____ on the shortcut menu.
    7·1 answer
  • What does sustainable mean<br>​
    7·1 answer
  • What’s the difference between the logical and physical structure of a file? What are the advantages of not having an application
    15·1 answer
  • g Write a recursive function all capital (L,start ,stop) that takes a string L and two integers. It returns a Boolean (True/Fals
    8·1 answer
  • What are business rules​
    14·1 answer
  • In binary, the second digit from the right is multiplied by the first power of two, and the _____ digit from the right is multip
    10·2 answers
  • Hello :) new day <br> which one would u pick?<br> 1. chips 2. Gacha life 3. chocolate?<br><br> hehe
    15·2 answers
  • What is a banner grab?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!