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
State differences between title bar and menu bar​
jeyben [28]

Answer:

The answer to this question is given below in this explanation section.

Explanation:

                              "Title bar"

A title bar is a small strip that extends across the top of a window.It display the title of the window and typically include the close minimize and maximize button.In macros these buttons are on the left side of the title bar while in windows they are on the right.The title bar is a horizontal bar located at the top of a window in a GUI.It displays the title of the software name of the current.

                                   "Menu bar"

A menu bar is a graphical control elements which contains drop down menu.The menu bar purpose is to supply a common housing for window or application specific menu which provide access to such function as opening file interaction with an application or displaying help documentation or manuals.

7 0
2 years ago
sparse(compact) Description: A sparse matrix is a 2D matrix that has many zeros. Assume that for storage efficiency someone has
barxatty [35]

Answer:

Function sparse code is

def sparse(a):

rl = []

cl = []

for i in range(0,len(a)):

rl.append(a[i][1])

cl.append(a[i][2])

r = max(rl)

c = max(cl)

s = []

k = 0

for i in range(0,r+1):

s.append([])

for j in range(0,c+1):

if (i==a[k][1]) & (j == a[k][2]):

s[i].append(a[k][0])

k = k+1

else:

s[i].append(0)

return s

def main():

k = sparse([[3,1,2],[4,5,3]])

print(k)

if __name__ == '__main__':

main()

Explanation:

Please see attachment for output

8 0
3 years ago
Which would increase electric current? increasing the resistance increasing the size of the wire decreasing the voltage
Neko [114]
The answer is the second answer Increasing the size of the wire.
8 0
3 years ago
Why is it important to cite your sources?
emmainna [20.7K]

Answer:

It gives credit to the original author and shows that you are not taking credit for someone

else's work

7 0
3 years ago
Read 2 more answers
Which emerging technologies will have more injury on our day to day country &amp; How?​
qwelly [4]

Explanation:

Complete the sentence with the words below stop push direction slow down move shape speed up pull A force is a. or a.

4 0
2 years ago
Other questions:
  • Which kind of software allows users to draw pictures, shapes, and other graphical images with various on-screen tools such as a
    14·1 answer
  • A third-grade teacher at Potter Elementary School wants a program that allows a student to enter the amount of money a customer
    14·1 answer
  • As an improvement of the ATX form factor over AT, shorter wires made it easier to shield them and made them capable of handling
    6·1 answer
  • python Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value i
    7·1 answer
  • TRUE OR FALSE!!<br> Your location can be identified simply by turning on your cell phone..
    12·2 answers
  • Vpn stands for _____. very precise settings virtual private network virtual public network vice prestigious setup
    5·1 answer
  • Universal containers set the organization-wide defaults for cases to private. When a case is escalated, case ownership changes t
    13·1 answer
  • Wht is these things Aᔑ bʖ cᓵ d↸ eᒷ f⎓ g⊣ h⍑ i╎
    15·2 answers
  • Which finger is used to press SHIFT key while typing!
    14·2 answers
  • A local pizza shop is selling a large pizza for $9.99. Given the number of pizzas to order as input, output the subtotal for the
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!