Answer to Question #4621 in C++ for ken

Question #4621
(1) Write a program that prompts a user for a filename of an existing file that contains 10 lines of student names. Assume that names are of equal length and they are inserted into a file based on the order of the student’s ID. The IDs are from 1-10 and thus the order of the student in the file is his/her ID. Next, the program reads the filename, reads the student ID and then seeks to the line that contains the student name, reads it byte by byte and writes it into a new output file.
(Note: create the input file before you run the program)

it should be done in seek method (seekg)

(2) Write a program that prompts a user for a filename of an existing file that contains 10 lines of student names of equal lengths and the name of student to be searched. Next, the program search for the name using binary search within the file (NOT in main memory) and indicates whether the name exist or not.
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS