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
Ad libitum [116K]
3 years ago
6

Read first a user's given name followed by the user's age from standard input. Then use an ofstream object named outdata to writ

e this information separated by a space into a file called outdata. Assume that this is the extent of the output that this program will do. Declare any variables that you need.
Computers and Technology
1 answer:
Stells [14]3 years ago
8 0

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.

You might be interested in
Which of the following is an online library?
Mice21 [21]
Answer A. Hope it helped c:
4 0
3 years ago
Read 2 more answers
What Active Directory object enables an administrator to configure password settings for users or groups that are different from
e-lub [12.9K]

Answer:

Password Settings object

Explanation:

Active Directory is made up of different services that are aimed at handling the access and permissions to resources over a network. It was developed by Microsoft and was originally used for centralized domain management but has evolved past that now.

In AD, the data stored are also known as Objects, these objects can be

  1. users or a group that has been given passwords and/or
  2. resources such as computers or printers.
  3. Organizational Units (OUs)

The object responsible for handling the configuration of passwords configuration is the Password Settings object.

Here, all settings relating to password setup, configuration, reset and so on takes place here. The settings can be applied to groups or users which can show the complexity, length, history of the password and so on.

8 0
4 years ago
What imaging test can tell the speed and direction of blood
Sindrei [870]
A doppler ultrasound
8 0
3 years ago
Describe the object-oriented software engineering approach.
Jobisdone [24]

Answer:

 The object oriented software engineering approach is basically focus on the attention for capture the given structure and conduct the data frameworks in the form of small module which consolidates the information and the procedure.

The principle and aim of the Object Oriented Design (OOD) is that improving the quality of the system analysis and increase its productivity and more usable efficiently.

There are different phases in the object oriented software engineering approach are as follows:

  • Firstly, we start analyze and define the particular system
  • Then, construct the analysis model based on the above approach of the specific system.
  • We verify the correctness of the system by using the testing.

3 0
4 years ago
If I wanted to add code so that the costume of my sprite would change, what menu would I look under to find the "change costume"
Damm [24]

Answer:

D.) Looks

the costume is technically the look of your sprite, so looks is the correct answer

7 0
3 years ago
Other questions:
  • Consider two different implementations, M1 and M2, of the same instruction set. There are three classes of instructions (A, B, a
    14·1 answer
  • Documents on the web stored on web servers are known as web _____.
    6·1 answer
  • 01010010 01100101 01100001 01101100 00100000 01101101 01110101 01110011 01101001 01100011 00100000 01110100 01101001 01101100 01
    5·2 answers
  • The computer output for integer programs in the textbook does not include reduced costs, dual values, or sensitivity ranges beca
    14·1 answer
  • Carbon copy others who are..
    14·2 answers
  • Often technical personnel who are not familiar with security techniques think that restricting access to ports on a router or fi
    5·1 answer
  • Please help on both of these questions will give brainliest<br> !!
    9·2 answers
  • Compare and contrats the vain digestive system from the human digestive system.​
    10·1 answer
  • Could anyone help me with this assignment please?
    6·1 answer
  • Please help me please please
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!