Answer:
/*
* Program to write data to text file.
*/
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
int main()
{
//Variable to name and age of a person.
string name;
int age;
cout<<"Enter your name"<<endl;
cin>>name;
cout<<"Enter your age"<<endl;
cin>>age;
//Creating object of ofstream.
ofstream file;
file.open ("outdata.txt");
//Writing data to file named outdata.txt
file<<name<<" "<<age;
file.close();
}
Output:
Enter your name
John
Enter your age
25
Content of Output.txt:
John 25
Explanation:
To write data to a file ofstream object is used. An ofstream object file is created first and then using this object a file named "outdata.txt" is created.
Finally using shift operator (<<), by means of operator overloading, name and age of person is transferred to file outdata.txt.
Answer:
The number of seagulls in each location.
Explanation:
Dependent variables are something that you are recording or measuring.
Answer:
An integer data type is a location where text cannot be stored
Explanation:
In computer science and computer programming, a data type or simply type is an attribute of data which tells the compiler or interpreter how the programmer intends to use the data.
A data type constrains the values that an expression, such as a variable or a function, might take. This data type defines the operations that can be done on the data, the meaning of the data, and the way values of that type can be stored.
Common examples of data types are
1.Integer: accepts integer numbers
2.Floating-point number: accept decimal numbers
3.Character: accepts character values
4.String. Accepts multiple characters
4.Boolean. Returns true or false logical expression
Md command, (make directory) creates a directory. It's a subdirectory when you md under a directory.
<em>Shift </em>selects multiple worksheets at the same time. <em>Ctrl</em> selects all that you selected with Ctrl pressed.