Concept explainers
Insertion Sort on a File II
Modify the program written for
name of a person and an integer to hold the person’s age. The file should be sorted by alphabetic order of the names.
Want to see the full answer?
Check out a sample textbook solutionChapter 13 Solutions
Starting Out with C++: Early Objects (9th Edition)
Additional Engineering Textbook Solutions
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Problem Solving with C++ (9th Edition)
Artificial Intelligence: A Modern Approach
Introduction To Programming Using Visual Basic (11th Edition)
- (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays so that a customer’s record can be accessed randomly by account number. Create the file by entering five customer records, with each record consisting of an integer account number (starting with account number 1000), a first name (maximum of 10 characters), a last name (maximum of 15 characters), and a double-precision number for the account balance. After the file is created, write a C++ program that requests a user-input account number and displays the corresponding name and account balance from the file.arrow_forward(Statistics) Write a program that includes two functions named calcavg() and variance(). The calcavg() function should calculate and return the average of values stored in an array named testvals. The array should be declared in main() and include the values 89, 95, 72, 83, 99, 54, 86, 75, 92, 73, 79, 75, 82, and 73. The variance() function should calculate and return the variance of the data. The variance is obtained by subtracting the average from each value in testvals, squaring the values obtained, adding them, and dividing by the number of elements in testvals. The values returned from calcavg() and variance() should be displayed by using cout statements in main().arrow_forward(List maintenance) The following letters are stored in an alphabet array: B, J, K, M, S, and Z. Write and test a function named adlet(), which accepts the alphabet array and a new letter as arguments, and then inserts the new letter in the correct alphabetical order in the array.arrow_forward
- instruction: C++ languagearrow_forwardC++arrow_forwardTask 3: Statistics using arrays: by java programming With the spread of COVID 19, the HR department in a company has decided to conduct some statistics among the employees in order to determine the number of infections according to some conditions. For each employee, they have to record the code, name, age, whether he/she was infected or no and the remaining days of leaves for him/her. You are requested to write the program that maintains the lists of details for the employees as mentioned above using the concept of arrays. The program repeats the display of a menu of services until the user decides to exit. 1. Start by initializing the employee details by reading them from the keyboard. 2. Repeat the display of a menu of 4 services, perform the required task according to the user’s choice and asks the user whether he/she wants to repeat or no. You need to choose one service from each category (‘A’,’B’,’C’,’D’) a. A. Display the total number of employees that were infected b. B.…arrow_forward
- File Analysis USING PYTHON- DICTIONARY NOTE FIND ATTACHED BELOW 2 FILES THA SHOULD BE USED FOR THIS ASSIGNMENT Using python, Write a program that reads the contents of two text files and compares them in the followingways:It should display a list of all the unique words contained in both files.It should display a list of the words that appear in both files.It should display a list of the words that appear in the first file but not the second.It should display a list of the words that appear in the second file but not the first.It should display a list of the words that appear in either the first or second file, but notboth.Hint: Use set operations to perform these analyses. ATTACHED FILES first FILENAME: first_file.txt The quick brown fox jumps over the lazy dog. Second FILENAME: second_file.txt Jack be nimble, Jack be quick, Jack jump over the candlestick. . For the program, you need to write: Comments for all the values, constants, and functions IPO Variables Pseudocodearrow_forwardAll code in JAVASCRIPT Write a program that creates two files with the names file4 and file4a two 10 element int arrays with the names arrfile4 and arrfile4a; these arrays are to have different values write the contents of arrfile4 to file4write the contents of arrfile4a to file4aarrow_forwardC languagearrow_forward
- C++ language Write a program that asks a user to input 10 numbers. The numbers are stored in the array if itis not Odd and not already available. After creating the array, it asks the user to enter a numberand deletes it from the array.arrow_forwardC++ arrays task The scientist monitors the movement of a particle suspended on the surface of the water and records its coordinates every n seconds. make a program that calculates the minimum, average, and maximum velocities of the particle and the distance traveled by the particle. The first line of the original data file contains the number of particle coordinates m (1 <m <100) and the coordinate capture interval in n (n> 0) seconds. The following lines show the particle coordinates xi and yi (1 <i <m) in millimeters (xi and yi are real numbers). Record the minimum, average, and maximum velocities of the particle and the distance traveled by the particle in the result file.arrow_forwardAdd distribution function in code The system should allow the employees to list all distributed vaccines and their accumulated quantities read from the dist. txt file. Note: The vaccines and their distributed quantities need to be sorted in descending order (with highest quantity listed first followed by second highest and so on) using Bubble sort before displaying on the screen. MY C Programming CODE: #include <stdio.h> #include <stdlib.h> #include <string.h> // Function Declarations void create_inventory(); void update_vacc_qty(); int search_vaccine(); void display_vaccine(); // Main Function starts here int main() { create_inventory(); display_vaccine(); search_vaccine(); //update_vacc_qty(); return 0; } //Function to Create Vaccine.txt as per the given table void create_inventory() { int option = 1; // variables to collect data as per table given char vaccName[15]; char vaccCode[2]; char country[15]; int qty; float populaion; //File definition FILE *infile;…arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT