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
PLEASE HELP GIVING 25 POINTS Sophia is leading a project to help clean up a local river in her area. She creates an online forum
nignag [31]

Answer:

She holds useful online meetings

Explanation:

5 0
3 years ago
Read 2 more answers
How to create PowerPoint presentation computer networking using visual diagrams
DanielleElmas [232]

https://www.google.com/url?sa=t&source=web&rct=j&url=https://support.office.com/en-us/article/video-create-a-network-diagram-a2360cd9-5c9d-4839-b4f6-17b485e02262&ved=2ahUKEwjlr4bdjd7hAhUiyYUKHR1UC1EQwqsBMAB6BAgLEAU&usg=AOvVaw3ZFpgzww1z4gFaeRCROkF-

7 0
3 years ago
I'm in middle school but when I singed in I accidentally put high school, how can I change that?
Pani-rosa [81]
Go to edit profile then go to preferences and select school level

8 0
3 years ago
Read 2 more answers
Four possible skills a person could have
cluponka [151]

Answer:

Active listening skills.

Genuine interest in others.

Flexibility.

Good judgment.

Explanation:

4 0
4 years ago
Caleb is working on a simple logic-based program to simulate a game of tic-tac-toe. Which programming language would he use?.
noname [10]
The logic required to write a tic-tac-toe game can be achieved using any third-generation programming language, and there are many to choose from, for example, Python, Fortran, C++ etc. For a simple program where it is easy to add graphic objects, a fourth-generation programming language may be more suitable.
6 0
4 years ago
Read 2 more answers
Other questions:
  • n the declaration: string color = "blue"; A. the string literal color is assigned to the string reference "blue" B. the string r
    11·2 answers
  • Amy has decided to use a dark background and light colored text for her prensentation. Which toolbar option will let her change
    5·1 answer
  • Which presidential race has been called “the dirtiest in American history”
    10·1 answer
  • How can you create the first row of the table as the header of the table?
    8·1 answer
  • I am in desperate need to graduate. Overloaded with tons of online homework to be completed before the school year ends. I don't
    5·1 answer
  • Suppose two computers (A & B) are directly connected through Ethernet cable. A is sending data to B, Sketch the waveform pro
    9·1 answer
  • What is stored in alpha after the following code executes?
    9·1 answer
  • Hi there. I need to know that if I take computer fundamentals, will that class teach anything about graphic design or digital de
    9·1 answer
  • Why authentication processes and features important
    10·1 answer
  • Write the steps involving coping and pasting a file in a folder​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!