
would you write the c++ program which is written in pseudocode:
Code 1:
input file A contains numeric values
output File A is sorted
a ← read Value (A)
while not End Of File (A) performs
b ← read Value (A)
if a > b then
return false
end if
a ← b
end while
return true
Code 2:
input files A and B are sorted according to Code 1
output The file C contains all values from A and B in sorted order
a← read Value (A)
b ←read Value (B)
while not End Of File (A) And not End Of File (B) perform.
Determines which value to write to C
if a < b then
Write a to C
a ← read Value (A)
else
Write b to C
b← read Value (B)
end if
end while.
A or B is over, write both clearly
while not End Of File (A) performs
Write a to C
a← read Value (A)
end while
while not End Of File (B) performs
Write b to C
b← read Value (B)
end while

Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 9 images

- Time Write a Python script that extracts and prints a single record from an input file in which organized by line. Each line contains the name of a person (possibly containing multiple followed by the year of his birth. Abbas ibn Firnas ibn Wirda: 809 Muhammad ibn Musa al - Khwarizmi: 780 Abu Al - Walid Muhammad Ibn Ahmad Rushd: 1126 The program uses function extract DataRecord with the specification: @param infile the input text file object @return pants a list containing the name (string) in the first element and the year of bir the second element. If the end of file was reached, an empty list is returnedarrow_forwardGiven a file with data for names and marks you will read them into two arrays You will then display the data, do a linear search and report if found, sort the data, do a binary search. Be sure to test for found and not found in your main program. Read Data Write a function that reads in data from a file using the prototype below. The function can define and open the file, read the names and marks into the arrays and keep track of how many names there are in numElts, and then closes the file. The list of names and marks can be found at the end of the lab and copied into a text file. void getNames(string names[], int marks[], int& numElts); Display Data Write a function to display the contents of names and marks using the prototype given below. void displayData(const string names[], const int marks[], int numElts); Linear Search Write the searchList function given the prototype below so that it searches for a given name. The functions returns and int which is…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





