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
spin [16.1K]
3 years ago
8

Write a program that read first a user's given name followed by the user's age from standard input. Then use an ofstream object

named outdata (which you must declare) to write 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:
mr_godi [17]3 years ago
3 0

Answer:

Following are the program to this question:

#include <iostream> //defining header file

#include <fstream>//defining header file

using namespace std;

int main()//defining main method

{   string name; //defining string variable

   int age; //defining integer variable

   cout << "Enter your name: "; //print message

   getline(cin, name); //input value using getline method

   cout << "Enter your age: "; //print message

   cin >> age; //input value

   ofstream outdata("outdata"); //using ofstream method

   outdata << name << " " << age << endl; //print value

   outdata.close(); //closing outdata.

   return 0;

}

Output:

Enter your name: dev

Enter your age: 22

please find the attachment.

Explanation:

Description of the above can be described as follows:

  • In the main method, two variable "name and age" is declared, in which name is string variable, and age is an integer variable, in both variable, we take user input, but in the name variable, the inline method is used, that take input from the user end.
  • In the next step, ofstream method is used, which creates an object "outdata", which prints user input value in the "outdata" file separated by a single space.

You might be interested in
What are the three main purposes of an operating system? Explain how the old mainframe computers were different from the compute
lbvjy [14]

Answer:(1) To manage the computer's resources, which includes central processing unit, memory, disk drives, and printers, (2) To establish a user interface

(3)To execute and provide services for applications software.

The old mainframe computers have

(1) low memory sizes

(2) slower connectivity speed

(3) Larger sizer

(4) low sophistication.

Explanation: Operating system is a system software that manages the computer resources,helps to establish user interface and it helps to provide services for application softwares.

Operating system software includes WINDOWS X,WINDOWS 7,WINDOWS 8,LINUX,etc.

Mainframe computers are computers used by large multinational companies for processing bulk data. Old mainframe computers were produced by IBM(INTERNATIONAL BUSINESS MACHINE) in the year 1952 they are classed two scientific and commercial mainframe computers with different information although they had some incompatibilities. Old mainframe computers are large in size with low processing speed, sophistication and storage compared to present day system.

3 0
4 years ago
Write a Python function that join the two string and print it ​
liubo4ka [24]

Answer:

string1 = "this is string 1"

string2 = " this is string 2"

print(string1 + string2)

Explanation:

the string1 variable is assigned with a string value(aka. str)

string2 is also a variable assigned with a slightly different string value

the 3rd line then prints string 1 and 2 to the console.

5 0
3 years ago
Read 2 more answers
How can you enter Task Manager in Windows? Select 3 options. press Ctrl + Shift + Tab press Ctrl+Alt+Delete and then click Task
Sophie [7]

Answer:

Please find the 3 options below.

Explanation:

To begin with, Task Manager in windows, is a monitor program that provides information or shows application and processes running on a computer. Task manager also provide insights about the general status of a computer. The three options for entering or accessing task manager in windows are:

1. Press Ctrl+Alt+Delete and then click Task Manager

2. Right-click the taskbar and choose Start Task Manager

3. Right-click the taskbar and choose Manage Tasks

5 0
4 years ago
In terms of resource utilization, a /an application may require higher local
aksik [14]

Answer: A) Installed

Explanation: Installed application work on the system on which they are installed .They are supposed to persist the required speed of processing to execute the task ,enough memory and other resources as well to fulfill the need of the application functioning.

Other option is incorrect because cloud based application run with help of internet service via web browser so they resources in this applications based on the internet connectivity and browser's speed .Thus, the correct option is option(A).

3 0
4 years ago
Which of the following would be considered a subtopic for a mind map?
Grace [21]

Answer:

C) Plants

Explanation:

"Ecosystem" is the topic. Then "Plants" is the sub topic. Next the "Number of trees" and "Number of shrubs" branch out from there (Pun intended (; ).

4 0
3 years ago
Other questions:
  • What happens when your computer is in Hibernate mode?
    12·1 answer
  • Describe an application or a situation in which it is not convenient to use a linked list to store the data of the application
    12·1 answer
  • . Which of the following is NOT an option for increasinghard drive storage space?
    6·1 answer
  • The most accurate readings that you can take on an analog VOM are when the meter's pointer is at the A. center scale. B. extreme
    11·1 answer
  • Grace is performing a penetration test against a client's network and would like to use a tool to assist in automatically execut
    13·2 answers
  • 3.26 LAB: Leap Year A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate a
    15·2 answers
  • We can use formatting before and after typing.​
    8·1 answer
  • 1. Software that is designed to intentionally cause harm to a device, server, or network is A. outware B.loggerware C.
    12·1 answer
  • Software licensed as proprietary
    11·2 answers
  • How to give a file name as an argument in function in python.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!