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:
A query in a database is a request for information stored within a database management system (DBMS), which is the software program that maintains data.
SQL(Structured Query Language ( is a standard language for storing, manipulating, and retrieving data in database.
Five types of SQL queries are:
1) Data Definition Language (DDL).
used to define and modify the structure of a database.
2) Data Manipulation Language (DML).
used to manipulate (change) the data in the database.
3) Data Control Language(DCL).
used for access control and permission management for users in the database.
4) Transaction Control Language(TCL).
used for maintaining consistency of the database and for the management of transactions made by the DML commands.
5) Data Query Language (DQL).
used for performing queries on the data within schema objects.
Answer:
D. spyware
Explanation:
Well it kind of explains itself. He wants to "spy" on their activities.
Answer:
def print_popcorn_time(bag_ounces):
if bag_ounces<3:
print("Too Small")
elif bag_ounces>10:
print("Too Large")
else:
bag_ounces = bag_ounces*6
print("%s Seconds\n" % bag_ounces)
Explanation:
- Using Python Programming Language
- The function is defined to accept an int parameter
- Within the function body, if...elif and else statements are used to print the desired output
- note the use of the %s placeholder (formated output) and \n for a new line in the final print statement
Hey There!
A percent can be used in a filename.