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
Can any one help me please with my computer science hwk :)
Artyom0805 [142]

Answer:

I think the answer to this problem is true

5 0
3 years ago
Write a c++ program that generates three random numbers. The first number should be between 0-30, the second number should be be
Rama09 [41]

Answer:

#include <stdlib.h>

#include <time.h>  

#include <iostream>

using namespace std;

int main() {

   srand(time(NULL));

   cout << rand() % 30 << endl;

   cout << rand() % 30 + 30 << endl;

   cout << rand() % 30 + 60 << endl;

}

Explanation:

rand() returns a pseudo-random integral number in the range between 0 and RAND_MAX. By applying the modulo operator, you map that to the desired range (30 in your case), then you add an offset.

8 0
3 years ago
Explain each of the three important concepts behind the Federal Networking Council's definition of the term Internet. Explain ho
maria [59]

Answer:

The three important concepts in the Federal Networking Council's definition of the Internet are, namely;

  • Packet switching
  • The TCP/IP communications protocol
  • Client/server computing

Explanation:

  • Packet switching involves the transfer of data which are grouped into different packets and then sent over a digital network to their respective destination. After the data are received at the destination site, they are then extracted and used by the application software.
  • The transmission control protocol/internet protocol allows one computer to connect or communicate with another one through the internet. The internet protocol defines how to route and address each packet to ensure it gets to the right destination. The IP address of a particular device on a network is usually unique to that device.
  • Client/server computing describes how a server provides services by taking requests from clients computers and sharing its resources with one or more computers.
7 0
3 years ago
could someone plz enplane to me what iOS r because i go to donlaod a app on my phone and it says i need to upgrade to a iOS 8.0
Nezavi [6.7K]
If it says that you may need to do updates
8 0
4 years ago
Read 2 more answers
1. Why isn't solar energy usually the only power source for a region?
ale4655 [162]
1. Every region doesnt get the same amount of sunlight as the rest due to whether or location an example would be that a region with alot of rain could have clouds that wouldnt let the solar panels to absorb as much sunlight as a more dry and sunny place 
2 wind farms can be used to store energy for a power outage and a way to lower the cost of electricity to a farmer 
3 using hydro energy requires people to build a dam that pours the water over a mill that rotates and stores energy from it 
4 a type of waste created by nuclear power plants would be daily uses that have radiation such as plastic containers ,gloves , disposable overalls, boots or just plain radioactive waste.
5 would be the total mass of organisms in a given area or volume 
6 is a process to further limit carbon dioxide emissions from burning coal
7 is basically the means to tap into energy savings that over time become an asset 
8 turning down the water heater thermostat and turning off lights when not in use can save energy 
9 smart grids use timing grid to determine how long you use electricity for and for how much you used
6 0
3 years ago
Read 2 more answers
Other questions:
  • In normal view, powerpoint's ________ contains buttons such as notes, comments, and view.
    14·1 answer
  • What does an operating system do?
    11·2 answers
  • In the receiving computer, UDP receives a datagram from the __________ layer.
    15·1 answer
  • _____ was just a sophomore when he began building computers in his dorm room at the University of Texas. His firm would one day
    14·1 answer
  • in a deisgn project, what two types of graphics or images is the digital artist respondsible for creating?
    11·1 answer
  • (main.c File)
    7·1 answer
  • If the code for JAVA is LCXC, what is the code for BASIC?
    12·1 answer
  • An organization has hired a new remote workforce. Many new employees are reporting that they are unable to access the shared net
    11·1 answer
  • You have just purchased a new Dell PowerEdge R820 Rack Server. The server is equipped with four Xeon E5-4650 CPUs, 128 GB of RAM
    8·1 answer
  • What made the digital distribution of both data and visualization more accessible to a broader audience?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!