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
DochEvi [55]
3 years ago
15

What special member function of a class is called whenever an instance of a class is created and initialized?

Computers and Technology
1 answer:
allochka39001 [22]3 years ago
6 0
It's called a constructor function, but it's name is the same as the class' name.
You might be interested in
Which are the best examples of costs that should be considered when creating a project budget?
Vlada [557]

Answer:

I would say material costs and hiring costs, idk if that helps or not

4 0
3 years ago
p25: File Write and Read1) User enters a file name (such as "myMovies.txt").2) User enters the titles of 4 of their favorite mov
SCORPION-xisa [38]

Answer:

<em>The program goes as follows  </em>

<em>Comments are used to explain difficult lines</em>

#include<iostream>

#include<fstream>

#include<sstream>

#include<string>

using namespace std;

int main()

{

//Declare String to accept file name

string nm;

//Prompt user for file name

cout<<"Enter File Name: ";

getline(cin,nm);

//Create File

ofstream Myfile(nm.c_str());

//Prompt user for 4 names of movies

string movie;

for(int i = 1;i<5;i++)

{

 cout<<"Please enter a movie title #"<<i<<": ";

 cin>>movie;

 //Write to file, the names of each movies

 Myfile<<movie<<endl;

}

Myfile.close(); // Close file

//Create an Array for four elements

string myArr[4];

//Prepare to read from file to array

ifstream file(nm.c_str());

//Open File

if(file.is_open())

{

 for(int i =0;i<4;i++)

 {

  //Read each line of the file to array (line by line)

  file>>myArr[i];

 }

}

file.close(); // Close file

//Create a reverseOrder.txt file

nm = "reverseOrder.txt";

//Prepare to read into file

ofstream Myfile2(nm.c_str());

for(int j = 3;j>=0;j--)

{

 //Read each line of the file to reverseOrder.txt (line by line)

 Myfile2<<myArr[j]<<endl;

}

Myfile2.close(); //Close File

return 0;

}

See attached for .cpp program file

Download cpp
6 0
3 years ago
Consider the cement used for the foundation; the bricks and timber used for the walls; and the shingles used for the roof. All o
gavmur [86]
<span>Consider the cement used for the foundation; the bricks and timber used for the walls; and the shingles used for the roof. All of these are __________ in making the house.

A. Elements</span>
6 0
3 years ago
Match the steps with the actions that are involved when an internal host with IP address 192.168.10.10 attempts to send a packet
Anna35 [415]

Answer:

Following are the steps with actions that are involved in required to perform a packet transfer.

Explanation:

  • Step 1: The host sends a connection request to server which is at IP address 209.165.200.254
  • Step 2: R1 check the configuration of NAT to inquire weather the packet should be translated or not.
  • Step 3: If there is no entry found for translation of given IP address, It is assumed that the IP address 192.168.10.10  will be translated already.
  • Step 4: R1 selects a global address  from the dynamic address pool that is available to it.
  • Step 5: R1 replaces the given IP address 192.168.10.10  with the translated inside global address.

i hope it will help you!

5 0
2 years ago
[1] Please find all the candidate keys and the primary key (or composite primary key) Candidate Key: _______________________ Pri
AVprozaik [17]

Answer:

Check the explanation

Explanation:

1. The atomic attributes can't be a primary key because the values in the respective attributes should be unique.

So, the size of the primary key should be more than one.

In order to find the candidate key, let the functional dependencies be obtained.

The functional dependencies are :

Emp_ID -> Name, DeptID, Marketing, Salary

Name -> Emp_ID

DeptID -> Emp_ID

Marketing ->  Emp_ID

Course_ID -> Course Name

Course_Name ->  Course_ID

Date_Completed -> Course_Name

Closure of attribute { Emp_ID, Date_Completed } is { Emp_ID, Date_Completed , Name, DeptID, Marketing, Salary, Course_Name, Course_ID}

Closure of attribute { Name , Date_Completed } is { Name, Date_Completed , Emp_ID , DeptID, Marketing, Salary, Course_Name, Course_ID}

Closure of attribute { DeptID, Date_Completed } is { DeptID, Date_Completed , Emp_ID,, Name, , Marketing, Salary, Course_Name, Course_ID}

Closure of attribute { Marketing, Date_Completed } is { Marketing, Date_Completed , Emp_ID,, Name, DeptID , Salary, Course_Name, Course_ID}.

So, the candidate keys are :

{ Emp_ID, Date_Completed }

{ Name , Date_Completed }

{ DeptID, Date_Completed }

{ Marketing, Date_Completed }

Only one candidate key can be a primary key.

So, the primary key chosen be { Emp_ID, Date_Completed }..

2.

The functional dependencies are :

Emp_ID -> Name, DeptID, Marketing, Salary

Name -> Emp_ID

DeptID -> Emp_ID

Marketing ->  Emp_ID

Course_ID -> Course Name

Course_Name ->  Course_ID

Date_Completed -> Course_Name

3.

For a relation to be in 2NF, there should be no partial dependencies in the set of functional dependencies.

The first F.D. is

Emp_ID -> Name, DeptID, Marketing, Salary

Here, Emp_ID -> Salary ( decomposition rule ). So, a prime key determining a non-prime key is a partial dependency.

So, a separate table should be made for Emp_ID -> Salary.

The tables are R1(Emp_ID, Name, DeptID, Marketing, Course_ID, Course_Name, Date_Completed)

and R2( Emp_ID , Salary)

The following dependencies violate partial dependency as a prime attribute -> prime attribute :

Name -> Emp_ID

DeptID -> Emp_ID

Marketing ->  Emp_ID

The following dependencies violate partial dependency as a non-prime attribute -> non-prime attribute :

Course_ID -> Course Name

Course_Name ->  Course_ID

So, no separate tables should be made.

The functional dependency Date_Completed -> Course_Name has a partial dependency as a prime attribute determines a non-prime attribute.

So, a separate table is made.

The final relational schemas that follows 2NF are :

R1(Emp_ID, Name, DeptID, Marketing, Course_ID, Course_Name, Date_Completed)

R2( Emp_ID , Salary)

R3 (Date_Completed, Course_Name, Course_ID)

For a relation to be in 3NF, the functional dependencies should not have any transitive dependencies.

The functional dependencies in R1(Emp_ID, Name, DeptID, Marketing, Date_Completed) is :

Emp_ID -> Name, DeptID, Marketing

This violates the transitive property. So, no table is created.

The functional dependencies in R2 (  Emp_ID , Salary) is :

Emp_ID -> Salary

The functional dependencies in R3 (Date_Completed, Course_Name, Course_ID) are :

Date_Completed -> Course_Name

Course_Name   ->  Course_ID

Here there is a transitive dependency as a non- prime attribute ( Course_Name ) is determining a non-attribute ( Course_ID ).

So, a separate table is made with the concerned attributes.

The relational schemas which support 3NF re :

R1(Emp_ID, Name, DeptID, Course_ID, Marketing, Date_Completed) with candidate key as Emp_ID.

R2 (  Emp_ID , Salary) with candidate key Emp_ID.

R3 (Date_Completed, Course_Name ) with candidate key Date_Completed.

R4 ( Course_Name, Course_ID ).  with candidate keys Course_Name and Course_ID.

6 0
3 years ago
Other questions:
  • April 107 90 29 31 66 0.344
    8·1 answer
  • Using the notation exemplified in following question , list a set of tables and attributes (and identify keys) to represent the
    10·1 answer
  • Explain how each of the five types of prewriting assist a writer in getting started. please make it short.
    15·1 answer
  • Which of the following is not a metamorphic agent?
    8·2 answers
  • This method of advertising is expensive but can be the most effective method.
    15·1 answer
  • Give a real life of an if statement
    13·1 answer
  • Ayudaa, 5 ejes de sistemas tecnológicos
    5·1 answer
  • Need help:(!!!! I’ll mark brainliest if correct
    5·1 answer
  • mary has access to certain resources because she is in the Research division of her company. She has access to other resources b
    15·1 answer
  • What kind of energy transformation occurs when you call someone on a cell phone?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!