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
Both instructions and data in a digital<br>computer are represented as binary<br>digits. True False​
MrRissso [65]

Answer:

False

Explanation:

insturctions are represented in binary numbers, data are represented in decimal numbers.

6 0
2 years ago
Which one is the result of the output given by a compute
sveta [45]

Answer:

Images.

Sound.

Hardcopy

…

3 0
2 years ago
Read 2 more answers
1. What is the main factor that affects Earth’s average temperature?
user100 [1]

Answer:

1. The Sun is the primary source of energy that influences any planet's temperature, including Earth. The amount of energy received from the Sun is called insolation; the ratio reflected is called the albedo.

2.There are three major ways in which global warming will make changes to regional climate: melting or forming ice, changing the hydrological cycle (of evaporation and precipitation) and changing currents in the oceans and air flows in the atmosphere

3.The warming of Earth is primarily due to accumulation of heat-trapping greenhouse gases, and more than 90 percent of this trapped heat is absorbed by the oceans. As this heat is absorbed, ocean temperatures rise and water expands. This thermal expansion contributes to an increase in global sea level.

4.The main sources of greenhouse gases due to human activity are: burning fossil fuels leading to higher carbon dioxide concentrations. farming and forestry — including land use change via agriculture and livestock. cement manufacture.

5. - Reduce, Reuse, Recycle

- Use Less Heat and Air Conditioning

-Use Less Hot Water

Explanation:

5 0
3 years ago
Which cell formatting is most likely to use $?
TiliK225 [7]
Currency is the correct answer
4 0
3 years ago
Read 2 more answers
When using for loops and two-dimensional arrays, the outside loop moves across the ___________ and the inside loop moves across
lana66690 [7]

Answer: rows, columns

Explanation: :)

6 0
2 years ago
Other questions:
  • Which of these is an aggregator?
    9·2 answers
  • Some technologies like vertical farming have a number of negative effects. Which is a negative outcome of this technology? A. In
    10·1 answer
  • Write and run a Python program that asks the user for a temperature in Celsius and converts and outputs the temperature in Fahre
    10·1 answer
  • Which activity does not allow a person to perform any work while at the shop
    10·1 answer
  • Kyle asked his supervisor which type of computing model was used when the enterprise first started. She explained that the organ
    14·1 answer
  • So I was looking at my profile and it says i'm a brainly PLUS member didn't sign up for it tho. Any ideas why this could have ha
    14·2 answers
  • How do you invite someone to a conversation on brainly
    14·1 answer
  • Binary search takes a list of information and divides the list into two parts, one is divided and one is kept.
    15·1 answer
  • What game is this?????????????????????
    15·1 answer
  • What is the greatest number of bits you could borrow from the host portion of a class B subnet mask and still have at least 130
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!