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
My name is Ann [436]
3 years ago
9

Assuming dataFile is an ofstream object associated with a disk file named payroll.dat, which of the following statements would w

rite the value of the salary variable to the file
A) cout < B) ofstream C) dataFile << salary;
D) payroll.dat <
Computers and Technology
1 answer:
svet-max [94.6K]3 years ago
8 0

Answer:

dataFile << salary;

Explanation:

To write salary to a file (payroll.dat) using ofstream, you make use of the following instruction:

<em>ofstream dataFile; </em>

<em>myfile.open ("payroll.dat"); </em>

<em>myfile <<salary; </em>

<em>myfile.close();</em>

<em />

This line creates an instance of ofstream

<em>ofstream dataFile; </em>

This line opens the file payroll.dat

<em>myfile.open ("payroll.dat"); </em>

This is where the exact instruction in the question is done. This writes the value of salary to payroll.dat

<em>myfile <<salary; </em>

This closes the opened file

<em>myfile.close();</em>

<em />

<em />

You might be interested in
Create a cell array containing the same data as above (Do not use built-in functions such as cell2array, struct2cell, etc. but u
Anna71 [15]

Answer:

clc;

clear all;

disp('Creating the cell arr of required values')

arr = { 'Alejandro', 11, {3 5 7 9}, {0 0}, 'UCSD2016';...

{8 6 4 2 0 -2}, pi, 'Stephanie', {1 0}, {'(858) 273-0173'} }

disp('First row second column')

exp1 = arr(1 : 2, 2)

disp('Third element of 2nd row 1st column')

exp2 = arr{2, 1}(1,3)

disp('Deleting last 2 elements of 1st row 2nd column')

arr{1, 3}(3:4) = []

disp('log of 2nd row 2nd column')

arr{2, 2} = log(arr{2, 2})

disp('Swapping 1st row 1st column with 2nd row 3rd column')

temp = arr{2, 3};

arr{2, 3} = arr{1, 1}

arr{1, 1} = temp

disp('Deleting 2nd row 1st column elements')

arr{2, 1}(1:6)=[]

disp('Deleting third column')

arr(:,3) = []

6 0
3 years ago
What is the name for unwanted software that installs when you click some links?
Rudik [331]
Malware you're welcome 
8 0
4 years ago
Read 2 more answers
Does anyone else realize how the only tutor is for math never any other subjects?​
Slav-nsk [51]

Answer:

yes I do and I wonder why ??

7 0
3 years ago
You are the IT security manager for a retail merchant organization that is just going online with an e-commerce website. You are
lions [1.4K]

Answer:

Input validation, Allowing script input, and Escaping metacharacters

Explanation:

A programmer can implement the most effective way to prevent XSS by validating input, coding defensively, escaping metacharacters, and rejecting all script-like input.

4 0
3 years ago
What is a graphics card and what does it do?
prisoha [69]
Its basically a chip in a computer microprocessor, it allows the microprocessor to work at full speed. it also hamdles video calculation within the computer.
6 0
4 years ago
Read 2 more answers
Other questions:
  • Suppose the program counter (pc) is set to 0x2000 0000. is it possible to use the jump (j) mips assembly instruction to set the
    15·1 answer
  • A ____ port is a connection in which eight data lines transmit an entire byte of data at one moment in time.​
    10·1 answer
  • In order for an IT security framework to meet information assurance needs, the framework needs to include policies for several a
    13·1 answer
  • Network and web0based software used for workplace collaboration is commonly called?
    11·1 answer
  • 1.using synonyms can help make ur writing more________
    11·1 answer
  • What cell address indicates the intersection of the first row and the first column in a worksheet?
    15·2 answers
  • What happened if the offshore team members are not able to participate in the iterations demo due to timezone/infrastructure iss
    12·1 answer
  • True or False: <br> The object reference can be used to polymorphically store any class in Java.
    13·1 answer
  • Charlie makes pizza at a restaurant. The customers always compliment how great the pizza tastes. But Charlie takes a long time t
    7·2 answers
  • Which IP QoS mechanism involves prioritizing traffic? Group of answer choices IntServ RSVP COPS DiffServ None of the above
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!