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
umka21 [38]
3 years ago
8

Write a program to read a record from a binary file

Computers and Technology
1 answer:
BlackZzzverrR [31]3 years ago
4 0

Answer:

To read a record from binary file in C++ use read method.

Syntax: ifstream& write(const char*, int);

Explanation:

Algorithm:

Begin

  Create a structure Student to declare variables.

  Open binary file to write.

  Check if any error occurs in file opening.

  Initialize the variables with data.

  If file open successfully, write the binary data using write method.

     Close the file for writing.

  Open the binary file to read.

  Check if any error occurs in file opening.

  If file open successfully, read the binary data file using read method.

     Close the file for reading.

  Check if any error occurs

  Print the data.

End

You might be interested in
A written guarantee to fix or replace an item is called a _____.
VladimirAG [237]
A warranty is a statement given by the manufacturer or other company
3 0
4 years ago
Read 2 more answers
___ a Word object in an Excel worksheet to activate the Word features. A. Ctrl-click. B. Shift-click C. Double-click D. Click
givi [52]
D.....................
8 0
3 years ago
Read 2 more answers
Kevin is a DJ and has a passion for creating and modifying audio tracks. Which application software facilitates him in his passi
stiv31 [10]
B. Multimedia software
5 0
3 years ago
Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90)
yanalaym [24]

Answer:

The solution in python.

Output:

   print("0 is not a valid interstate highway number")

Explanation:

h = int(input("enter highway number: ")) #take highway number

if(h>=1 and h<=99): #for primary highway

   if(h%2==0):

       print("I-%d is primary, going east/west" %h) #for even highway number

   else:

       print("I-%d is primary, going north/south" %h) #for odd highway number

elif(h>=100 and h<=999): #for auxiliary highway

   aux=str(h) #convert into string for fetch the rightmost number

   l=len(aux) #find the length

   val = aux[l-2]+aux[l-1] #assign value of rightmost two number

   h = int(val) #convert into integer

   if(h%2==0):

       print("I-"+aux+" is auxiliary,"+"serving I-%d, going east/west" %h)

   else:

       print("I-"+aux+" is auxiliary,"+"serving I-%d, going north/south" %h)

elif(h==0):#for 0 highway number

   print("0 is not a valid interstate highway number")

else:

   pass

7 0
3 years ago
List the different generation of computers with its main component​
Dennis_Churaev [7]

Answer:

1940 – 1956:  First Generation

1956 – 1963: Second Generation

1964 – 1971: Third Generation

1972 – 2010: Fourth Generation

2010-  : (Present )Fifth Generation

Explanation:

  1. First Generation Computers (1940-1956):In this Generation the main component of computers were Vacuum Tubes.
  2. Second Generation Computers (1956-1963):In this generation the main component of computers were Transistors.
  3. Third Generation Computers (1964-1971):In this generation the main component of computers were Integrated Circuits.
  4. Fourth Generation Computers (1972-2010):In this generation the main component of computers were Microprocessor
  5. Fifth Generation (2010-Present):In this generation the main component of computers is Artificial Intelligence
4 0
3 years ago
Other questions:
  • One metric ton is approximately 2,205 pounds.
    6·1 answer
  • What is SAFFiR? (The robot)
    12·1 answer
  • At some point in your driving career, you will most likely be faced with an oncoming vehicle swerving into your travel lane. tru
    6·1 answer
  • Which of the following is not a metamorphic agent?
    8·2 answers
  • You have an interface on a router with the IP address of 192.168.192.10 /29. What is the broadcast address the hosts will use on
    15·1 answer
  • You must _____ the recording of the macro when you have completed the tasks it was designed to do
    10·1 answer
  • Upang mas maging maganda ang larawang ini-edit, dapat isaalang-alang ang tatlong mahahalagang elemento. Ano-ano ang mga ito?​
    6·1 answer
  • __ allow(s) users with mobility issues to control the computer with their voice.
    6·2 answers
  • Lol WAKE UP!!! and get ready to answer my questions.
    12·1 answer
  • Which company provides a crowdsourcing platform for corporate research and development?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!