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
Stella [2.4K]
2 years ago
14

C++

Computers and Technology
1 answer:
vichka [17]2 years ago
4 0

Answer:

#include <iostream>

#include <map>  

using namespace std;

int main()

{

   map<int, int> numbers;

   cout << "Enter numbers, 0 to finish" << endl;

   int number;

   while (true) {

       cin >> number;

       if (number == 0) break;

       numbers[number]++;

   }

   for (pair<int, int> element : numbers) {

       std::cout << element.first << ": occurs " << element.second << " times" << std::endl;

   }

}

Explanation:

One trick used here is not to keep track of the numbers themselves (since that is not a requirement), but start counting their occurrances right away. An STL map< > is a more suitable construct than a vector< >.

You might be interested in
Write the SQL statements that define the relational schema (tables)for this database. Assume that person_id, play_id, birth_year
Sunny_sXe [5.5K]

Answer:

  • SQL statement that defines table for Actor

CREATE TABLE Actor(

person_id integer primary key,

name varchar2(40) not null,

birth_year integer check ((birth_year) <= 2019)

);

  • SQL statement that defines table for Play

CREATE TABLE Play(

play_id integer primary key,

title varchar2(60) not null,

author varchar2(60) not null,

year_written integer check ((year_written) <= 2019)

);

  • SQL statement that defines table for Role

CREATE TABLE Role (

person_id integer,

character_name varchar2(60) not null,

play_id integer,

constraint fk_person foreign key (person_id) references actor(person_id),

constraint fk_play foreign key (play_id) references play(play_id),

primary key (person_id, character_name, play_id)

);

Explanation:

Other information that were not added to the question are as below:

The following database contains information about three tables i.e. actors, plays, and roles they performed.

Actor (person_id, name, birth_year)

Play (play_id, title, author, year_written)

Role (person_id, character_name, play_id)

Where: Actor is a table of actors, their names, and the year they were born. Each actor has a unique person_id, which is a key.

Play is a table of plays, giving the title, author, and year written for each play. Each play has a unique play_id, which is a key.

Role records which actors have performed which roles (characters) in which plays.

Attributes person_id and play_id are foreign keys to Actor and Play respectively.

All three attributes make up the key since it is possible for a single actor to play more than one character in the same play

Further Explanation:

In SQL, in order to define relational schema (Tables) for a database, we use CREATE TABLE statement to create a new table in a database.  The column parameters specify the names of the columns of the table.  The datatype parameter specifies the type of data the column can hold (varchar, integer, date)

4 0
3 years ago
The internet is ________. an internal communication system for businesses a large network of networks a communication system for
uranmaximum [27]

A large network of networks

<h3>What Is a large network?</h3>
  • It is the biggest network that connects computers across the world. With the internet, people can share data and files over the internet. The Internet is defined as a network of networks Hence it is the correct option

To learn more about the network, refer

to https://brainly.in/question/32165678

#SPJ4

4 0
1 year ago
Which function is used for creating a date table?
netineya [11]

Explanation:

When one wants to express his or her feelings on each other

4 0
2 years ago
The keyboard shortcut to save a file is _______.<br><br> Ctrl-s
asambeis [7]
Yes its Ctrl + S and if you want to save as press F12
8 0
3 years ago
Owners of individual domains get to decide what content is published on their websites. Why might this autonomy be important to
Alika [10]

Answer:

Explanation:

With an individual domain name we can upload all the content we want, in a free domain or share domain, upload content in some cases have a limit, for example the size of an image, in an individual domain we can add our brand, in a shared, we can add our brand side to company share those domains, we can have our own email address, practically we have a complete autonomy in our website.

4 0
3 years ago
Other questions:
  • Why should you limit what information is in your digital footprint?
    12·1 answer
  • How might your use of computers and knowledge of technology systems affect your personal and professional success?
    7·2 answers
  • The __________ is a visual or textual storyboard that will assist in determining the type of web pages on your site.
    14·1 answer
  • In apersuasive message, opposing ideas should be:
    13·1 answer
  • Assume that you are testing the Orders database introduced in Watt (2014) - Appendix C. Discuss the problems and possible conseq
    12·1 answer
  • Which of the following is an example of joint problem solving?
    12·1 answer
  • The signature area in a cover letter includes the sender's first and last name, followed by his/her job title (if applicable). *
    13·1 answer
  • If you wanted to divide an integer variable by 2, which of the following lines of code would you use? total = int + 2 total = in
    6·1 answer
  • One benefit of taking notes in class is that the student
    9·1 answer
  • Difine Mainframe Computer~<br><br><br><br><br><br><br><img src="https://tex.z-dn.net/?f=%20%5C%3A%20%20%5C%3A%20" id="TexFormula
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!