A file has r=20000 STUDENT records of fixed-length. Each record has the following fields: NAME (30 bytes), SSN (10 bytes), ADDRESS (40 bytes), PHONE (9 bytes), BIRTHDATE (8 bytes), SEX (1 byte), MAJORDEPTCODE (4 bytes), MINORDEPTCODE (4 bytes), CLASSCODE (4 bytes, integer), and DEGREEPROGRAM (3 bytes). Suppose the block size is 512 bytes.
Q: A temperature file consists of five records, each containing a temperature in degrees Fahrenheit. A…
A: Step-1: Start the program. Step-2: Open an input temperature file. Step-3: Print the column heading…
Q: Bella is a psychology student who is carrying out an experiment in which she repeatedly asks people…
A: #Create a function with file name as parameter def make_dictionary(fileName): #Open the file in…
Q: he teacher at a school needs help grading an exam with a number of True/False questions. The…
A: Required: The student’s ID is ABC54102, answer to question 1 is True, the answer to question 3 is…
Q: Create a data file with 1000 lines. Each line in the file consists of a faculty first name, last…
A: Algorithm : Step 1 : import the library random. Step 2 : create and open the file 'salary.txt'.…
Q: USING PYTHON Write a program that uses a dictionary to assign “codes” to each letter of the…
A: A required Python program is as follows, def encryption(codes): # Open file with normal message…
Q: Write a program that uses a dictionary to assign “codes” to each letter of the alphabet. For…
A: In this program we read content of file and replace with corresponding codes from dictionary.…
Q: A database for the telephone directory is maintained in the file "tele.txt" with the following…
A: Since no programming language is mentioned, I am using python. Code:…
Q: and print the the result as follows: the files and the database file (Export/ Export work with a…
A: Below is the required PHP program. Program Approach: Create a table as addresses with four…
Q: Given the 5 records below stored in a file, write a code snippet that will extract two elements…
A: Since no programming language is mentioned the question, I have provided the code in java language…
Q: Lab: Faculty Salaries 1. Create a data file, called salary.txt, with 100 lines. 2. Each line in…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: B’ : ‘@’, ‘b’ : ‘#’, etc . . .}Using this example, the letter A would be assigned the symbol %, the…
A: given - #program should be written in python with comments. Write a program that uses a dictionary…
Q: written in Java.
A: Complete explanation is given below.
Q: For example, suppose the word “robot" is found in lines 7, 18, 94, and 138. The dictionary would…
A: Since you did not specify a language, I wrote the code in python
Q: Write a program that expands on the program below (i.e. reading data of each record in the file and…
A: Programming instructions: Open the file with the filename in writing mode. Write the values of…
Q: Write a program to take input for n book records from user and write those book records in a file…
A: EXPLANATION: The first step is to include the necessary header files. Then create a structure that…
Q: (Baby name popularity ranking) The popularity ranking of baby names from the years 1960s to 2010 are…
A: Required:
Q: WHATS THE ALGORITHIM FOR THIS The course records are shown below: Each student has 4…
A: Introduction: WHAT IS THE ALGORITHM FOR THIS The course records are shown below: Each student has…
Q: 1st: Write a shell script program (easterbunny.sh) which can create a circular letter for an Easter…
A: Solution # Hello World Program in Bash Shell echo "Enter the number" #asking for input read num…
Q: Parallel Programming It is vaccine season! COVID19 vaccines are out, and everyone is rushing to get…
A:
Q: A file has r = 20, 000 STUDENT records of fixed length. Each record has the following fields: NAME…
A: GIVEN A file has r = 20, 000 STUDENT records of fixed length. Each record has the following fields:…
Q: Write a program that reads the contents of a text file. The program should create a dictio-nary in…
A: Step 1 In the above program is not mentioned any programming language.. I am using python to…
Q: file containing data about some students' options regarding a set of optional subjects is given. The…
A: To read data from the file #include <stdio.h> int main(void){ char name[50000]; int…
Q: Suppose that the file inData.txt, data set 1, contains the following data: Giselle Robinson…
A: Note: The program is complied using Dev C++. PROGRAM: //Header files #include <iostream>…
Q: . Assume that the reference variable r refers to a serializable object. Write code that serializes…
A: Below is the required piece of code to serialize object:
Q: The owner of Quick Breakfast Cafe (qbc), has provided a text file (see given qbc_menu_prices.txt)…
A: The answer is in below steps:
Q: Consider the binary file named, "Course_Data" whose format is below. Each record represents a course…
A: Course_Data obj; int avg=0; for(int i=1;i<=obj.NOA;i++){ if(obj.LGrade=='A'){ avg+=obj.NGrade; }…
Q: given a text file (data1.txt) that consists of different garbage strings. 1.Create a new file, from…
A: Answer: Since file data is not given, I have used some test data. Algorithm: Start Create a class…
Q: Create a data file with 1,000 lines. Each line in the fileconsists of a faculty member’s first name,…
A: Purpose of the program: This program creates a text file containing the details like the faculty…
Q: aking the attached code as a basis: Employee.py. Write code that reads from the attached…
A: Q: Code the given problem
Q: file contains a list of telephone number in following form. Aman 23456 Raj…
A: Note: We are authorized to answer one problem at a time since you have not mentioned which one you…
Q: def read_cars(full_path_file_name): """ Read the data from csv file given full path file name…
A: A simple Car class is constructed for implementing this and you can replace it with your own…
Q: Write a program, BytePe1.java, that reads a binary file ClassList.dat, calculating the grades and…
A: Solution:-- 1)The given question has required for the solution to be provided in the Java…
Q: A file contains a list of telephone number in following form. Aman 23456 Raj…
A: #include <bits/stdc++.h>using namespace std;int main(){ fstream my_file;…
Q: write in c++ Write a program that would allow the user to interact with a part of the IMDB movie…
A: Implementation details Your program should contain a structure: Movie. Has 4 fields: id - integer…
Q: Write a program that reads the student information from a tab separated values (tsv) file. The…
A: Answer: Code: try: # opening file for reading fileread= open("StudentInfo.tsv") # opening file for…
Q: int main () int x = 30; int y - 27: int z - bigger (x, y): int w - smaller (x, y): return 0; } //…
A: The, code has given below:
Q: Write a C++ program called ant.cpp that reads files of this type (i.e., your program should work…
A: #include<iostream>#include<fstream>#include<cmath>using namespace std;double…
Q: A vector is given by X = [-1, 2, -3, 8, 0, - 7, 12, 4, 20, -6, 6, 4, -7, 16]. Write a program as a…
A: Python Program :- X=[-1,2,-3,8,0,-7,12,4,20,-6,6,4,-7,16]X1=[]X2=[] for i in X: if i>=0 and…
Q: In Java A comma separated value (.csv) file has been included to be used for this program. Each…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: file operator code 1 // The FileOperator class that includes methods for file input and output 2 //…
A: FileWriter class in Java is used to write character-oriented data to a file. write() method is used…
Q: Scenario You are required to tally the results of a small football competition. Based on an input…
A:
Q: In Java Oleae nust read a file A photographer is organizing a photo collection about the national…
A: Actually, Java is a general-purpose also class-based, object-oriented programming language designed…
Q: file operator code 1 // The FileOperator class that includes methods for file input and output 2 //…
A: A class is a group of objects which have common properties. A constructor is a method that is used…
Q: WAP to read 4 student objects and write them into a file, then print total number of student number…
A: The code is written below: #include<iostream> #include<fstream> using namespace std;…
Q: SUBJECT NAME IS C++: WAP to read 4 student objects and write them into a file, then print total…
A: Procedure Followed: Include header files. Start class Student. Declare Variables for student…
Q: Write a program that prompts the user to enter a text file name (either mbox.txt or mbox-short.txt),…
A: #file name input name = input("Enter file:") fh = open(name) #dict mails ids and count master =…
Q: The student information is seperated by a comma and is in the following format :…
A: The program is written in cpp
Q: Consider a square region in the first quadrant of the Cartesian plane whose bottom left and upper…
A: Here is the program with the function:
Q: A file contains a list of telephone number in following form. Aman 23456 Raj…
A: Note: We’ll answer the first question since the exact one wasn’t specified. Please submit a new…
Q: reads in a file of student academic credit data. Each line of the input file will contain the…
A: Programming is instructing a computer to do something for you with the help of a programming…
- A file has r=20000 STUDENT records of fixed-length. Each record has the following fields: NAME (30 bytes), SSN (10 bytes), ADDRESS (40 bytes), PHONE (9 bytes), BIRTHDATE (8 bytes), SEX (1 byte), MAJORDEPTCODE (4 bytes), MINORDEPTCODE (4 bytes), CLASSCODE (4 bytes, integer), and DEGREEPROGRAM (3 bytes). Suppose the block size is 512 bytes.
(a) Calculate the record size R in bytes.
(b) Calculate the blocking factor (number of tuples per block) and the number of blocks required.
(c) Calculate the average block accesses it takes to find a record by doing a linear search on the file.
(d) Assume the file is ordered by SSN; calculate the block accesses takes to search for a record given its SSN value by doing a binary search.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- A file has r = 20, 000 STUDENT records of fixed length. Each record has the following fields: NAME (30 bytes), SSN (9 bytes), ADRESS(40 bytes), PHONE(9 bytes), BIRTHDATE (8 bytes), SEX(1 byte), CLASSCODE( 4 bytes, integer) MAJORDEPTCODE(4 bytes), MINORDEPTCODE(4 bytes), and DEGREEPROGRAM( 3 bytes). An additional byte is used as a deletion marker. Block size B = 512 bytes. a) Calculate the blocking factor bfr (=floor(B/R), where R is the record size) and number of file blocks b, assuming unspanned organization (a record can’t be split across blocks). b) Suppose only 80% of the STUDENT records have a value for PHONE, 85% for MAJORDEPTCODE, 15% for MINORDEPTCODE, and 90% for DEGREEPROGRAM. We use a variable-length record file. Each record has a 1-byte field type for each field in the record, plus the 1-byte deletion marker and a 1-byte end-of-record marker. Suppose that we use a spanned record organization, where each block has a 5-byte pointer to the next block (this space is not used…PYTHONPLEASE ALSO SHARE CODE THROUGH LINK: online-python(dot)com Create a python program that reads the student information from a tab separated values (tsv) file. The python program then must creates a text file that will records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midtrm1 score, Midtrm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfoScore.tsv. Assume the number of students is at least 1 and at most 20. The program performs the following tasks: Read the file name of the tsv file from the user. Open the tsv file and read the student information. Compute the average exam score of each student. Assign a letter grade to each student based on the average exam score in the following scale: A: 90 =< x B: 80 =< x < 90 C: 70 =< x < 80 D: 60 =< x < 70 F: x < 60 Compute the average of each exam. Output the last names, first names, exam scores, and letter…DescriptionWrite a program to compute average grades for a course. The course records are in a single file and are organized according to the following format: each line contains a student's first name, then one space, then the student's last name, then one space, then some number of quiz scores that, if they exist, are separated by one space. Each student will have zero to ten scores, and each score is an integer not greater than 100. Your program will read data from this file and write its output to a second file. The date in the output file will be nearly the same as the data in the input file except that you will print the names as last-name, first-name; each quiz score, and there will be one additional number at the end of each line:the average of the student's ten quiz scores.Both files are parameters. You can access the name of the input file with argv[1]. and the name of the output file with argv[2].The output file must be formatted as described below: 1. First and last names…
- Java Problem The teacher at a school needs help grading an exam with a number of True/False questions. The students’ IDs and test answers are stored in a file. The first entry of the file contains the answer to the test in the form: TTFTFTTTFTFTFFTTFTTF Every other entry in the file is the student’s ID, followed by a blank, followed by the students’ response. For instance, the entry: ABC54102 T FTFTFTTTFTTFTTF TF The student’s ID is ABC54102, answer to question 1 is True, the answer to question 3 is False. Also, the student did not answer question 2 and question 18. The exam has 20 questions. Here is the grading policy: each correct answer is awarded two points, each wrong answer get -1 point, and no answer gets 0 point. Write a program that processes the test data. The output should be the student’s ID, followed by the answers, followed by the test score (total points), followed by the test grade. Assume the following grade scale will be used: 90%-100%, A; 80%-89.99%, B; 70%-79.99%,…The 2 pictures are the beginning of the lab. The below is for part 2. read_file(0, clear_file); // Read in a file with of unknown length, getting the length from the file read. clear_file is a string containing the path to the clear text file. This function returns a char array created with memory allocation. read_file(len, clear_file); // Where len > zero, reads len chars from a file. clear_file is a string containing the path to the clear text file. This function returns a char array created with memory allocation. write_file(0, key, key_file); // Writes a string to file until the \0 char is reached. key is the string of random chars and key_file is a string containing the path of the text file. write_file(len, cipher, cipher_file); // Where len > zero, writes len chars to a file. cipher is the cipher string of chars and cipher_file is a string containing the path of the text file. The menu in main() should look like: Encrypt a file: 1Decrypt a file: 2Exit:…IN C++ Write a program that reads movie data from a CSV (comma separated values) file and output the data in a formatted table. The program first reads the name of the CSV file from the user. The program then reads the CSV file and outputs the contents according to the following requirements: Each row contains the title, rating, and all showtimes of a unique movie. A space is placed before and after each vertical separator ('|') in each row. Column 1 displays the movie titles and is left justified with a minimum of 44 characters. If the movie title has more than 44 characters, output the first 44 characters only. Column 2 displays the movie ratings and is right justified with a minimum of 5 characters. Column 3 displays all the showtimes of the same movie, separated by a space. Each row of the CSV file contains the showtime, title, and rating of a movie. Assume data of the same movie are grouped in consecutive rows. Hints: Use the find() function to find the index of a comma in each…
- JAVA PPROGRAM Write a program that prompts the user to enter a file name, then opens the file in text mode and reads names. The file contains one name on each line. The program then compares each name with the name that is at the end of the file in a symmetrical position. For example if the file contains 10 names, the name #1 is compared with name #10, name #2 is compared with name #9, and so on. If you find matches you should print the name and the line numbers where the match was found. While entering the file name, the program should allow the user to type quit to exit the program. If the file with a given name does not exist, then display a message and allow the user to re-enter the file name. The file may contain up to 100 names. You can use an array or ArrayList object of your choosing, however you can only have one array or ArrayList. Input validation: a) If the file does not exist, then you should display a message "File 'somefile.txt' is not found." and allow the…Problem Definition You are provided with a text file (employees.txt) containing a number of text lines. Each line contains a record of one employee. Each record has three attributes: Title: string, Prof. (Professor) or Dr. (Doctor). First and Last names: string. Salary: float number. The attributes are separated by the character (','). Figure 1.a, 1.b, and 1.c show a sample of employees.txt files. Dr., Julia Scott,141518 Prof.,Joan Stewart,111673 Mr.,Ali Al-Shukaili,122311 Prof.,Sana Al-Abri,131673 Dr.,Fadi Al-Rasdhi,153790 Ms., Salwa Al-Youssfi, 111675 Dr.,Lillian Brown,67251 Dr.,Julia Scott,141518 Prof.,Joan Stewart Dr., Daniel Cooper,153790 Dr.,Lillian Brown,unknown Dr., Daniel Cooper,153790 Dr.,Lillian Brown,67251 Dr.,Benjamin Russel1,117642 Prof.,Patrick Bailey,72305 Dr., Ralph Flores,118457 Dr., Douglas Flores,181793 Dr.:Benjamin Russell:117642 Figure 1.b: A sample of the text file 'employees.txt Figure 1.a: A sample of the text file 'employees.txt without errors Figure 1.c: A…A temperature file consists of five records, each containing a temperature in degrees Fahrenheit. A program is to be written that will read the input temperature, convert it from degrees Fahrenheit to degrees Celsius and print both temperatures in two columns on a report. Column headings, which read ‘Degrees F’ and ‘Degrees C’, are to be printed at the top of the page. What ist he best solution algorithm to successfully implement the above question?
- Given a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the information into four separate arrays, and outputs the available food items in the following format: name (category) -- description Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character. Ex: If the input of the program is: food.txt and the contents of food.txt are: Sandwiches Ham sandwich Classic ham sandwich Available Sandwiches Chicken salad sandwich Chicken salad sandwich Not available Sandwiches Cheeseburger Classic cheeseburger Not available Salads Caesar salad Chunks of romaine heart lettuce dressed with lemon juice Available Salads Asian salad Mixed greens with ginger dressing, sprinkled with sesame Not available Drinks Water…Given a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the information into four separate arrays, and outputs the available food items in the following format: name (category) -- description Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character. Ex: If the input of the program is: food.txt and the contents of food.txt are: Sandwiches Ham sandwich Classic ham sandwich Available Sandwiches Chicken salad sandwich Chicken salad sandwich Not available Sandwiches Cheeseburger Classic cheeseburger Not available Salads Caesar salad Chunks of romaine heart lettuce dressed with lemon juice Available Salads Asian salad Mixed greens with ginger dressing, sprinkled with sesame Not available Drinks Water…Given a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the information into four separate arrays, and outputs the available food items in the following format: name (category) -- description Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character. Ex: If the input of the program is: food.txt and the contents of food.txt are: Sandwiches Ham sandwich Classic ham sandwich Available Sandwiches Chicken salad sandwich Chicken salad sandwich Not available Sandwiches Cheeseburger Classic cheeseburger Not available Salads Caesar salad Chunks of romaine heart lettuce dressed with lemon juice Available Salads Asian salad Mixed greens with ginger dressing, sprinkled with sesame Not available Drinks Water…