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
Mashutka [201]
3 years ago
8

Consider this data sequence: "fish bird reptile reptile bird bird bird mammal fish". There is a CONSECUTIVE REPETITION of length

3 (the three consecutive birds) and a CONSECUTIVE REPETITION of length 2 (the two reptiles). There are also several SINGLETONs of length 1 (a singleton fish, a singleton bird, a singleton mammal, and another singleton fish).Write some code that uses a loop to read in a sequence of words, terminated by the "xxxxx". The code assigns to t the number of CONSECUTIVE REPETITIONS that were read. (For example, in the above data sequence that value would be 2.) Assume that t 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:
ioda3 years ago
8 0

Answer:

The code is given below. Follow the question and the code definitions for better understanding.

Explanation:

#include<iostream>

#include<string>

using namespace std;

int main(){

string pastWord="";

string currentWord,nextWord;

int n,t;

int singleton=0;

int consecutive=0;

cout<<"Enter words. ('xxxxx' to exit):\n";

cin>>nextWord;

do{

currentWord=nextWord;

cin>>nextWord;

if ( (currentWord!=pastWord)&&(currentWord!=nextWord) )

singleton++;

else if((currentWord==pastWord)&&(currentWord!=nextWord))

consecutive++;

pastWord=currentWord;

}while(nextWord!="xxxxx");

n=singleton;

t=consecutive;

cout<<"There were "<<n<<" singletons and "<<t<<" consecutive repetitions.";

cin.get();

return 0;

}

You might be interested in
What are some similarity's between NES console and consoles today
blondinia [14]

Answer:

Old game consoles

New game consoles

Old games consoles like the NES, SNES, the SEGA Genesis were manufactured during the 1970's This generation started in the first and ends in the fifth

New game 3-D consoles like the PS3, X-Box 360 and the Wii U were manufactured during the late 90s to right now. This generation started in the sixth and ends at the eighth.

Facts

They have introduce a lot of game genres and characters like the Mario bros, The Legend of Zelda series, The Tetris game, and Sonic the Hedgehog series.

Genres like platformers and side scrollers were introduced in the 2-D era

New game consoles has introduce game genres like First Person Shooters. Games like Call of Duty and Halo are examples

The answer

The differences between an old console and a new console is not only the modeling of either the game console, but the functional properties and the way it operates. From each generation , there are about eight generations of consoles right now

The difference between an old generation of consoles and a new genration of console

Sources

http://www.answers.com/Q/What_is_the_difference_between_the_old_games_consoles_and_the_new_games_consoles

Pictures and more facts

The X-Box sucessor, the X-Box 360 was released in November 22, 2005 in the United States. Games like Halo and Call of Duty are the games that introduced really good First-Person Shooters

The Playstation 1, PSx, or the PS1 was made in September 9th 1995 in North America. The games that was in for the playstation is the famous Crash Bandicoot and Spyro the Dragon series and a few 2-d games.

The second picture the Super Nintendo Entertainment System or the SNES, was release to America in 1991 and is the sucessor of the NES

The games that was in the system was Super Mario World 1-2, The legend of zelda 3, which were one of the best selling games on the system

The first picture the Nintendo Entertainment System or the NES, that was released to America in 1985 and it was the best selling console at its time.

The games it introduce was of course Super Mario Bros 1-3, The Legend of Zelda 1-2

The third and last picture is the SEGA Overdrive or SEGA Genesis was releases to America in 1989 and rivaled with the SNES during the time.

Games that was with the system was SEGA's blue mascot Sonic the Hedgehog 1-3 and Knuckles, Teenage Mutant Ninja Turtles

PS1 fact

Even though the PS1 has its 2-D games, it also has 3-D games like the Crash Bandicoot and Spyro series made by Naughty Dog, who also did the Last of us game

Explanation:

the similarities are they both play games they both load some type of disk etc.

3 0
3 years ago
Read 2 more answers
What is the final amount stored in value if the computer selects 17 as the
nadya68 [22]

Answer: -17

Explanation:

Our random number is 17. Let's go through line by line.

  1. value is a random number picked which is 17
  2. valueB = 17 / 2 = 8.5
  3. If value is greater than 0 AND value has a remainder of 1, we will set the value to value* -1.
  4. Value is now 17 * -1 = -17

Let's quickly calculate value mod 2. 17 % 2 = is 1. If you're wondering how we did that, the remainder after dividing 8 into 17 twice is 1, because 17 - 16 = 1.

We stop after line 4 because we stop the conditional statement after one condition is filled.

6 0
3 years ago
_______ _____ is the process of creating usable computer pograms and applications and the theories behind those processes. Quest
stepladder [879]
<span>The correct answer is


C. Computer Science</span>
7 0
3 years ago
Read 2 more answers
Which is better intel or amd real debate.
natima [27]

I believe Intel is better at handling games. Not saying AMD isn't good, just not as good. AMD is better for handling multiple task. I personally don't mind either.

8 0
3 years ago
Read 2 more answers
Some projectors use a connection technology called _______________ that enables long-range connectivity for uncompressed HD vide
Rzqust [24]

Answer:

HDbaseT

Explanation:

HDbaseT is  a global connectivity standard for transmitting uncompressed high definition videos, audios, power, usb, ethernet home networking and some control signals for up to 100 meters, over a category cable like Cat 5a or Cat 6 cables.

The projector uses the HDbaseT for these reasons and for the fact that it eliminates clusters in cables without affecting its performance or high quality. This gives a high quality output display from the projector.

5 0
3 years ago
Other questions:
  • During the initiating phase, a project charter authorizes a project to begin. Which of the following elements are included in a
    15·1 answer
  • Why is it helpful that the ribbon tabs can collapse?
    8·1 answer
  • What kind of music you guys play
    5·2 answers
  • In electrical work, resistance is often represented by thea. Greek symbol O.
    12·1 answer
  • Which of the following is NOT an e-reader you would use as an alternative to carrying around a set of textbooks?
    13·1 answer
  • Write a Python program that asks the user for a positive, odd value. Once the value is validated determine if the number is Prim
    11·1 answer
  • How do u reverse image search on Android? ​
    9·1 answer
  • What is the minimum number of bits needed to store the decimal value 200?
    12·1 answer
  • 1:A presentation program which is developed by Microsoft
    12·2 answers
  • Javascript and java are really just two slightly different names for the same language.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!