Kyle_Smith_HW09
.docx
keyboard_arrow_up
School
Fort Hays State University *
*We aren’t endorsed by this school
Course
421
Subject
Computer Science
Date
Dec 6, 2023
Type
docx
Pages
3
Uploaded by DoctorMask12981
(CSCI 331) Homework Nine
Note:
The homework problems are selected from Chapter Nine of your textbook. The students
shall first read the book content and do all participant activities in corresponding section before they do the homework questions that are selected from that section. The homework needs to be typed in this word file and submitted via link on blackboard. You may rename this file as YourInitialsCSCI331HW09.docx.
Problem 1 (20 points) I/O Overhead
A fast laser printer produces 20 pages per minute, where a page consists of 4000 characters. The system uses interrupt-driven I/O, where processing each interrupt takes 50 μsec.
a)
How much overhead will the CPU experience if the output is sent to the printer one character at a time?
50*4000*20=4000000 microseconds = 4 seconds
4 seconds out of every minute are spent handling interrupts.
4/60=1/15 or 6.67%
b)
Would polling be a better approach than interrupts?
Yes, polling would be a better approach than interrupts. This is because the overhead of running
interrupts is much slower than read and write processes. Problem 2 (30 points) Polling vs interrupts.
A program is outputting a series of blocks by repeatedly issuing an I/O instruction.
a)
Executing the I/O instruction takes 1 unit of CPU time. All other instructions take 0 units of time.
b)
The device starts at the end of the I/O instruction and remains busy for 6 time units.
c)
When polling is used, the CPU polls the device every 5 time units.
d)
A poll takes 1 unit of CPU time.
e)
When interrupts are used, the interrupt handler takes 3 time units to process the interrupt.
Draw a timing diagram showing when the CPU and the device are busy during the first 24 time units
a)
with polling
b)
with interrupts
Problem 3 (30 points) Disk scheduling algorithms
The r/w head of a disk is at track 143. The previous position was track 0. Requests to access the following tracks have arrived:
143, 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130
a)
In which order will the tracks be visited using:
FIFO – 143, 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130
SSTF – 143, 130, 86, 913, 948, 1022, 1509, 1470, 1750, 1774
Scan – 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 130, 86
C-Scan – 143, 913, 948, 1022, 1470, 1509, 1750, 1774, 86, 130
b)
Starting from track 143, determine the number of tracks traversed by the r/w head under each algorithm to service all requests:
FIFO = 57 + 1384 + 557 + 861 + 826 + 561 + 487 + 728 + 1620 = 7081
SSTF = 13 + 44 + 827 + 35 + 74 + 448 + 39 + 241 + 24 = 1745
Scan = 770 + 35 + 74 + 448 + 39 + 241 + 24 + 1644 + 44 = 3319
C-Scan = 770 + 35 + 74 + 448 + 39 + 241 + 24 + 1688 + 44 = 3363
Problem 4 (20 points) Incorrect SSTF implementation.
The monitor below is an attempt to implement the SSFT algorithm.
monitor disk_scheduler {
condition q; position = busy = 0
move_to(destination) {
if (busy) q.wait(abs(destination - position))
busy = 1
position = destination
}
release() {
busy = 0
q.signal
}
Explain why the implementation does not correctly enforce the SSTF policy. Construct a scenario
to demonstrate the failure.
The problem is with the q.wait and q.signal operations. The q.wait(abs(destination – position)) line allows the thread to proceed but after waiting for a random amount of time. Therefore, this
does not guarantee that the seek time will be the shortest.
Scenario
Initial position: 100
Requests arrive in the following order: 50, 150, 200
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Average Number of WordsIf you have downloaded the source code from the Computer Science Portal you will find a filenamed text.txt in the Chapter 08 folder. The text that is in the file is stored as one sentenceper line. Write a program that reads the file’s contents and calculates the average number ofwords per sentence.(You can access the Computer Science Portal at www.pearsonhighered.com/gaddis.)
arrow_forward
1. Creating Employee Data ( Page 625)Create an application that allows the user to enter the following employee data: First Name, Middle Name, Last Name, Employee Number, Department, Telephone Number, Telephone Extension, and E-mail Address. The valid values for department are Accounting, Administration, Marketing, MIS, and Sales. Once the data is entered, the user should be able to save it to a file. Figure 9-30 shows an example of the application’s form. The form shown in Figure 9-30 has a combo box for selecting the department; a Save Record button, which writes the record to a file; a Clear button, which clears the text boxes; and an Exit button. Write code in the Form_Load event handler that allows the user to enter the name of the file. If the file does not exist, a new one will be created. If the file already exists, the input data will be appended to the file.
******** Make sure to test your project by entering a new text file name, and then to confirm you are appending data to…
arrow_forward
Search Algorithms
Dataset: We will use cars dataset as part of this project. The dataset is available as part of the assignment (cars.csv and a pdf that describe each of the fields for each record).
TASK 1
The idea of this project is to create a text-based application with the following options:
List all cars. This option will read from the file and when the user selects this option, the program will list all the cars in the file.
Find via Linear search. This option will allow the user to type a model of the car (ID field in the dataset) and it should print out the information about the car searched, the amount of time it took to find the car using linear search. For this option, create a class called SearchMethods and implement the method :
public static <T extends Comparable<T>> int linearSearch(T[] data, int min, int max, T target)
Find via Binary search. This option will allow the user to type a model of the car (ID field in the dataset) and it…
arrow_forward
A movie file has the following record structure: name of the movie producer director type production cost Assume that the name of the movie is the primary key of the file. The field type refers to the type of the movie, for example, drama, sci-fi, horror, crime thriller, comedy and so forth. Input a sample set of records of your choice into the movie file.i) Implement a primary index-based ISAM file organization.ii) Implement secondary indexes on director, type and production cost.iii) How could the secondary index-based file organization in Programming Assignment 3 (ii), be used to answer a query such as “Who are the directors who have directed films of the comedy or drama type, who have incurred the highest production cost?
arrow_forward
CLASS TEST 1-Word
File
Home
Insert
Design
Layout
References
Mailings
Review
View
Grammarly
O Tell me uhat you want to do
2 Share
E
H
The figure above depicts how data is stored in a database. By indexing the
nodes in the database from 0 to the highest number:
a) Generate the node data array
b) Generate the left pointer array
c) Generate the right pointer array
arrow_forward
Lab Objectives
To use functions that reads and writes from/to a file
Problem 1
A database file contains binary data (Check the sample data at the end of this
document). The file contains a number of records, each record is stored as a
"struct".
struct employee {
.
}
The struct is written to the file using fwrite. The sample data contains one
record with the following values.
123456, John Smith, 70 main St. Toronto, ON M3M 3M3, 9, 73123.45
Write a C program that performs the following
The file name is lab6_1.c
The file takes command line parameters (argc and argv)
If the command line arguments "-ID" followed by an integer, look for an
employee with that ID in the file. If that ID exists, print the name on a line
by itself. If There is no such ID print "No such employee" on a line by itself.
.
int Employee_ID;
char name [20]; // Employee name first name then last name
char address [50]; //The employee address might contains spaces
//Both name and address are terminated by
//a null…
arrow_forward
CCDConnect < C X
Dashboard - CCD X
M5 Assignment 1 x ▸ How to install Or X
https://mycourses.cccs.edu/d21/le/content/83491/viewContent/6197961/View
Requirements for Your M5 Assignment 1 Pseudocode for Program Integration
For the first module, write the pseudocode to process these tasks:
(Note: lines beginning with # are comments with tips for you)
2. Define a class called Dice
PDF Oracle 12c SQL (
1. From the random module import randint to roll each die randomly
a. # in pseudocode, import a random function
b. # the name is helpful for the next M5-2 assignment
a. In Python, the syntax has a colon after it: class Dice():
b. In pseudocode, you can specify it generally or be specific
3. Under the class declaration, list the attributes. Here are some tips:
a. # attributes are what we know about a single die (dice is plural)
b. # self is the first attribute in Python and must always appear first
c. # add a num_sides attribute and to set it to 6 for the 6 sides on the dice
4. Define a method…
arrow_forward
***Please write code suitable for Myprogramminglab below:
If you have downloaded the source code from this book's companion web site, youwill find the following files in the Chapter 07 folder:• GirlNames.txt--This file contains a list of the 200 most popular names given togirls born in the United States from the year 2000 through 2009.• BoyNames.txt--This file contains a list of the 200 most popular names given toboys born in the United States from the year 2000 through 2009.Write a program that reads the contents of the two files into two separatelists, allows a user to input either a girl's name, a boy's name, orboth, then tells the user whether the name(s) was/were popular between 2000 and2009.First, the program should prompt the user to choose a girl's name, a boy's name,or both by entering either 'girl', 'boy', or 'both.'Once they have chosen, they should be able to input a name. If the name wasa popular name, like Jacob or Sophia, the program should print "Jacob was apopular…
arrow_forward
Code
arrow_forward
Grade Roster Sort (file I/O)
My Solutions
The file RosterScores.txt contains student test scores with comma-delimited data similar to what is shown in the screen snip below.
Names, Scores
Marie Curie, 89
Caroline Herschel, 70
Mary Anning,93
Barbara McCiintock, 99
Dorothy Hodkin, 85
Write a script that loads the data from this file into a table aray variable named Rosterscores and sorts the rows in order of the test scores running highest to lowest. Save the
result in a new text file named RosterscoresSorted.txt.
arrow_forward
S82A58ipages
Student nunber
nmber(12)
Student _name
Varchar2(100)
Student_major
Number(6)
Addrew
Varchar2(100)
According to the schema and the fellowing Fam design answer the questions
STUDENT NUMBER
STUDENT NAME
SEARCH_BY_NAME
The system will Fill the list "Search_By_name"which is belong to "Info" Block with the names for all students when form load event (using
explicit cursor with For Loop), the return values from this list will be the student number 7 Note Give the names of the Triggers wil be usre
arrow_forward
Hi All, Please help me with this question.
Employee Registry This project requires the use of an employees.dat file (create your own file). The record format in the file is listed below (separated by a single space): first_name last_name employee_id phone_number Overview You’ve been asked by your employer to create an employee registry program. The program will be used by the HR department to maintain employee records. Requirements When your program starts, it should read the employees.dat file into memory. A menu should be displayed like below. List all employee details List employee by last name Add a new employee Remove an employee Show all managers only Show all staff only Quit Each menu option should be handled by its own function. You should add utility functions as needed. When option 1 is selected your program should list all the information for each employee in a tabular format. When option 2 is selected your program should prompt the user to enter an employee’s last name. If…
arrow_forward
C++ code
The Curl Up and Dye Beauty Salon maintains a master file that contains a record for each of its clients. Fields in the master file include the client’s ID number, first name, last name, and total amount spent this year. Every week, a transaction file is produced. It contains a customer’s ID number, the service received (for example, Manicure), and the price paid. Each file is sorted in ID number order.
a. Design the logic for a program that matches the master and transaction file records and updates the total paid for each client by adding the current week’s price paid to the cumulative total. Not all clients purchase services each week. The output is the updated master file and an error report that lists any transaction records for which no master record exists.
// Pseudocode PLD Chapter 7 #6a pg. 301// Start// Declarations// InputFile masterFile;// InputFile transactionFile;// OutputFile newMasterFile;// num mClientNumber, mtotalClientCost, tClientNumber, titemClientCost//…
arrow_forward
Holiday Travel Vehicle (HTV) sells new recreational vehicles and travel trailers. When new vehicles arrive at HTV, a new vehicle record is created. Included in the new vehicle record are a vehicle serial number, name, model, year, manufacturer, and base cost.
When a customer arrives at HTV, he or she works with a salesperson to negotiate a vehicle purchase. When a purchase has been agreed upon, a sales invoice is completed by the salesperson. The invoice summarizes the purchase, including full customer information, information on the trade-in vehicle (if any), the trade-in allowance, and information on the purchased vehicle. The invoice also summarizes the final negotiated price, plus any applicable taxes and license fees.
If the customer requests dealer-installed options (simply options), they are listed on the invoice as well. A customer may decide to have no options added to the vehicle or may choose to add many options. Dealer-installed options are described by an option code,…
arrow_forward
C++ Visual Studio 2019
Instructions
Complete #1 & #2. Please submit just one file for the classes and main to test the classes. Just create the classes before main and submit only one cpp file. Do not create separate header files. Please note: the deleteNode needs to initialize the *nodePtr and the *previousNode. The code to do this can be copied from here: ListNode *nodePtr, *previousNode = nullptr;
arrow_forward
Saving a Document as a Text File
Create a function save_document() that accepts the arguments filename and text and saves the text into the file filename. The filename should use the name of the document with ‘_edited_document’ appended to it.
For example, for the document text.doc, the save document should have the name text_edited_document.txt. The file should be saved in the folder “edits.” Assume that the folder already exists in the present working directory.
arrow_forward
Print Person Information from file
In this lab you are asked to complete the function : print_person_from_file(person_name, filename). This function should
read in data from the file filename and print the information for person_name if it is found in the file.
The file filename contains lines, in comma separated format (with a 'csv' extension) For each line, the items in each field are as follows:
Field
1
3
4
Name
Place of Birth Date of Birth Children
For Children:
• a person can have 0, 1 or multiple Children
Multiple children are semi-colon separated
If a person has no children the field contains 'NA'
For example, consider the following lines froma .csv file, where Fletcher_Margaret has 3 children, and Baker_Jill has 0 children
(field 4 contains the string 'NA')
Fletcher Margaret,Sydney,30-09-1921,Green Bob;Green Nancy;William Tom
Baker_Jill, Melbourne,08-09-1973, NA
Format for Printing
If the person_name is found in the file, the format for printing the person information is as…
arrow_forward
Menu option C The program reads in data from HowManyHours.txt, displays a report header with the report creator’s name, employee id, and department and who they created the report for. The body of the report displays the total number of students who used the program, the average credits taken, and the average study hours. In the following format –STUDY HOURS REPORT Created for Dr. Payne, A004567893 Dept: Computer Science
Created By: Karen Smith, A00494928Dept: Advising
Total Students: 3Average Credits: 9.00Average Study Hours: 20.00Menu option DThank the user for using the programTerminates the program
arrow_forward
Basic list structure, python code
You should allow users to enter information for five employees at the same time, where the first employee information entry is saved in index [0] and the second entry is saved in index [1], and so on. You want to make sure to enforce the user to enter the following employee information: employeeName, employeeSSN, employeePhone, employeeEmail, employeeSalary. After the user finishes entering the last employee information, they should get a message to allow them to print specific employee information from the saved list. The user can enter values between 1 and 5, where 1 will return the employee information saved in the list index [0], 2 will return the employee information saved in the list index [1] and so on.
The printed result should be in the following format:
Mike Smith, 123123,(111)222-3333,mike@gmail.com,$6000
arrow_forward
Finish this program from the code posted below! Note: There should be two files Main.py and Contact.py
You will implement the edit_contact function. In the function, do the following:
Ask the user to enter the name of the contact they want to edit.
If the contact exists, in a loop, give them the following choices
Remove one of the phone numbers from that Contact.
Add a phone number to that Contact.
Change that Contact's email address.
Change that Contact's name (if they do this, you will have to remove the key/value pair from the dictionary and re-add it, since the key is the contact’s name. Use the dictionary's pop method for this!)
Stop editing the Contact
Once the user is finished making changes to the Contact, the function should return.
Code:from Contact import Contactimport pickledef load_contacts():""" Unpickle the data on mydata.dat and save it to a dictionaryReturn an empty dictionary if the file doesn't exist """try:with open("mydata.dat", 'rb') as file:return…
arrow_forward
C LANGUAGE
Patient Following System ( C LANGUAGE )
Define a struct included patient number, name, age, and disease information.Main menu of the program includes the following operations:-create a patient file with 100 empty records.-Insert a new patient record.-Find and retrieve patient information.-Delete a patient record.-Modify a patient record.-List all patients information.
arrow_forward
Instructions
Write a program to implement the algorithm that you designed in
Exercise 20 of Chapter 1. (Assume that the account balance is
stored in the file Ch4_Ex15_Data.txt.)
Instructions to Exercise 20 of Chapter 1 have been posted below
for your convenience.
arrow_forward
Create a simple program for a quiz
Software Requirements:
Latest version of NetBeans IDE
Java Development Kit (JDK) 8
Procedure:
Create a folder named LastName_FirstName (ex. Dahan yoon) in your local
Create a new project named LabExer5B. Set the project location to your own
The program shall:
contain an array of 10 multiple choice questions with three (3) choices each and
require the user to choose among A, B, or C;
Note: Cases are ignored. Lowercase letters are acceptable (a, b, c).
Create a try-catch structure to handle three (3) exceptions. These are when the user inputs the following:
an invalid letter (not A, B, or C)
a number or any special character
blank (no answer)
Prompt the user that he can answer again if any of the three (3) exceptions is
Display the score.
arrow_forward
Program Specification
For this assignment you will write a program to help people record the events of their day by supplying prompts and then saving their responses along with the question and the date to a file.
Functional Requirements
This program must contain the following features:
Write a new entry - Show the user a random prompt (from a list that you create), and save their response, the prompt, and the date as an Entry.
Display the journal - Iterate through all entries in the journal and display them to the screen.
Save the journal to a file - Prompt the user for a filename and then save the current journal (the complete list of entries) to that file location.
Load the journal from a file - Prompt the user for a filename and then load the journal (a complete list of entries) from that file. This should replace any entries currently stored the journal.
Provide a menu that allows the user choose these options
Your list of prompts must contain at least five different prompts.…
arrow_forward
Hospital :ER Case Study
A General Hospital consists of a number of specialized wards (such
as Radiology, Oncology, etc) .Information about ward includes unique
name, total numbers of current patients. Each ward hosts a number of
patients, who were admitted by a consultant (doctors) employed by the
Hospital. On admission, the date and time are kept. The personal
details of every patient includes name, Medical Recode Number
(MRN), set of phone and one address (city, street, code). A separate
register is to be held to store the information of the tests undertaken.
Each test has unique episode No. , category and the final result of test.
Number of tests may be conducted for each patient. Doctors are
specialists in a specific ward and may be leading consultants for a
number of patients. Each patient is assigned to one leading consultant
but may be examined by other doctors, if required.
u
arrow_forward
Hospital :ER Case Study
A General Hospital consists of a number of specialized wards (such
as Radiology, Oncology, etc).Information about ward includes unique
name, total numbers of current patients. Each ward hosts a number of
patients, who were admitted by a consultant (doctors) employed by the
Hospital. On admission, the date and time are kept. The personal
details of every patient includes name, Medical Recode Number
(MRN), set of phone and one address (city, street, code). A separate
register is to be held to store the information of the tests undertaken.
Each test has unique episode No., category and the final result of test.
Number of tests may be conducted for each patient. Doctors are
specialists in a specific ward and may be leading consultants for a
number of patients. Each patient is assigned to one leading consultant
but may be examined by other doctors, if required.
arrow_forward
F# Exercises
This assignment consists of three F# exercises. The code for all exercises are included in the single file, hw4.fsx.
For each of the exercises, you are only required to write the provided functions. There is no additional global functionality. Your functions should produce no output. To test your functions, either:
Test the functions using the interactive simulator
Add your own tests to the script (but be sure to remove them or comment them out before submission)
Implementation Rules
You may define and use additional functions if your feel it is appropriate.
Without prior approval from me, you may only use the subset of F# described in class.
In particular, you may NOT use F# system functions (such as min) or methods
Even though they were mentioned in class, you are NOT allowed to use the methods in the List module such as List.map.
Second Exercise, elimDuplicates
Write a function elimDuplicates that takes a list of integers and eliminates consecutive duplicates;…
arrow_forward
INSTRUCTIONS:
• You are to answer this activity individually.
• You are to create a Python application that makes use of inputs, outputs, and sequence structures in Python.
• It must meet all of the following requirements:
• The application must create a list with exactly 10 items. The contents and type of list will be up to the student (e.g. Phone Brands, Types of Shoes, Shopping Apps). The application must first display the list
after which the application must remove 5 random items from the list. The application must then show the updated list with 5 of the items removed. After this is done, the application must add 7 new items to
the list. These items must be completely new and not the ones that were on the list initially. The application must then output the updated list with the added items. The application must then reverse the list
and then display the updated list after it has been reversed.
• The application must create a tuple with exactly 10 items. The contents and type of…
arrow_forward
In C Programming Language
Patient Following System1) Define a struct included patient number, name, age, and disease information.2) Main menu of the program include the following operations:◦ create a patient file with 100 empty records.◦ Insert a new patient record.◦ Find and retrieve patient information.◦ Delete a patient record.◦ Modify a patient record.◦ List all patients information.
I need more information for solution.
arrow_forward
Topics: Functions, Files Read and write, DictionarySuppose you are given an input file of a document that only contains English words, spaces, commas(always followed with one space) and periods (always followed with one space). Your task is to readthe file, count the word frequency by ignoring the letter case, output the frequently used words (i.e.,the words occurred more than once) and the most frequently used word among all of them.Lab Scenario: Count the word in a document1. The program reads from an already provided input file: “document.txt”, which containsseveral paragraphs separated by an empty line.2. You will perform the file open operation. And then perform the read operation with your choice ofread functions and read the content of the file.3. Once you are done reading, start processing the contents of the file using a dictionary where thekey would be the word in lowercase and the corresponding values would be word frequency whichwill be the number of occurrences in the…
arrow_forward
Python Programming Assignment: Create a dictionary that takes a basketball team's information (that includes team's name and points) as parameter, creates a teams_dict and returns it. Also, create a parameter for write_file parameter that opens current results text file in write mode and writes the dictionary information to file as per format and closes the file.
arrow_forward
Part B - reading CSV files
You will need a Python repl to solve part B.
Define a Python function named cheapest_rent_per_state that has one parameter. The parameter is a string representing the name of a CSV file. The CSV file will be portion of a dataset published by the US
government showing the median (middle) rent in every county in the US. Each row in the CSV file has the same format
Area Name, Efficiency, 1-Bedroom, 2-Bedroom, 3-Bedroom, 4-Bedroom, State Code
The data in the Area Name and State Code columns are text. The data in all of the other columns are decimal numbers.
Your function will need to use the accumulator pattern to return a dictionary. The keys of that dictionary will be the state codes read in from the file (state codes are at index 6). For each key in the dictionary, it's
value should be the smallest median rent for an efficiency in that state (median rents for an efficiency are at index 1).
Important Hints:
* You will really, really want to use the built-in csv…
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Related Questions
- Average Number of WordsIf you have downloaded the source code from the Computer Science Portal you will find a filenamed text.txt in the Chapter 08 folder. The text that is in the file is stored as one sentenceper line. Write a program that reads the file’s contents and calculates the average number ofwords per sentence.(You can access the Computer Science Portal at www.pearsonhighered.com/gaddis.)arrow_forward1. Creating Employee Data ( Page 625)Create an application that allows the user to enter the following employee data: First Name, Middle Name, Last Name, Employee Number, Department, Telephone Number, Telephone Extension, and E-mail Address. The valid values for department are Accounting, Administration, Marketing, MIS, and Sales. Once the data is entered, the user should be able to save it to a file. Figure 9-30 shows an example of the application’s form. The form shown in Figure 9-30 has a combo box for selecting the department; a Save Record button, which writes the record to a file; a Clear button, which clears the text boxes; and an Exit button. Write code in the Form_Load event handler that allows the user to enter the name of the file. If the file does not exist, a new one will be created. If the file already exists, the input data will be appended to the file. ******** Make sure to test your project by entering a new text file name, and then to confirm you are appending data to…arrow_forwardSearch Algorithms Dataset: We will use cars dataset as part of this project. The dataset is available as part of the assignment (cars.csv and a pdf that describe each of the fields for each record). TASK 1 The idea of this project is to create a text-based application with the following options: List all cars. This option will read from the file and when the user selects this option, the program will list all the cars in the file. Find via Linear search. This option will allow the user to type a model of the car (ID field in the dataset) and it should print out the information about the car searched, the amount of time it took to find the car using linear search. For this option, create a class called SearchMethods and implement the method : public static <T extends Comparable<T>> int linearSearch(T[] data, int min, int max, T target) Find via Binary search. This option will allow the user to type a model of the car (ID field in the dataset) and it…arrow_forward
- A movie file has the following record structure: name of the movie producer director type production cost Assume that the name of the movie is the primary key of the file. The field type refers to the type of the movie, for example, drama, sci-fi, horror, crime thriller, comedy and so forth. Input a sample set of records of your choice into the movie file.i) Implement a primary index-based ISAM file organization.ii) Implement secondary indexes on director, type and production cost.iii) How could the secondary index-based file organization in Programming Assignment 3 (ii), be used to answer a query such as “Who are the directors who have directed films of the comedy or drama type, who have incurred the highest production cost?arrow_forwardCLASS TEST 1-Word File Home Insert Design Layout References Mailings Review View Grammarly O Tell me uhat you want to do 2 Share E H The figure above depicts how data is stored in a database. By indexing the nodes in the database from 0 to the highest number: a) Generate the node data array b) Generate the left pointer array c) Generate the right pointer arrayarrow_forwardLab Objectives To use functions that reads and writes from/to a file Problem 1 A database file contains binary data (Check the sample data at the end of this document). The file contains a number of records, each record is stored as a "struct". struct employee { . } The struct is written to the file using fwrite. The sample data contains one record with the following values. 123456, John Smith, 70 main St. Toronto, ON M3M 3M3, 9, 73123.45 Write a C program that performs the following The file name is lab6_1.c The file takes command line parameters (argc and argv) If the command line arguments "-ID" followed by an integer, look for an employee with that ID in the file. If that ID exists, print the name on a line by itself. If There is no such ID print "No such employee" on a line by itself. . int Employee_ID; char name [20]; // Employee name first name then last name char address [50]; //The employee address might contains spaces //Both name and address are terminated by //a null…arrow_forward
- CCDConnect < C X Dashboard - CCD X M5 Assignment 1 x ▸ How to install Or X https://mycourses.cccs.edu/d21/le/content/83491/viewContent/6197961/View Requirements for Your M5 Assignment 1 Pseudocode for Program Integration For the first module, write the pseudocode to process these tasks: (Note: lines beginning with # are comments with tips for you) 2. Define a class called Dice PDF Oracle 12c SQL ( 1. From the random module import randint to roll each die randomly a. # in pseudocode, import a random function b. # the name is helpful for the next M5-2 assignment a. In Python, the syntax has a colon after it: class Dice(): b. In pseudocode, you can specify it generally or be specific 3. Under the class declaration, list the attributes. Here are some tips: a. # attributes are what we know about a single die (dice is plural) b. # self is the first attribute in Python and must always appear first c. # add a num_sides attribute and to set it to 6 for the 6 sides on the dice 4. Define a method…arrow_forward***Please write code suitable for Myprogramminglab below: If you have downloaded the source code from this book's companion web site, youwill find the following files in the Chapter 07 folder:• GirlNames.txt--This file contains a list of the 200 most popular names given togirls born in the United States from the year 2000 through 2009.• BoyNames.txt--This file contains a list of the 200 most popular names given toboys born in the United States from the year 2000 through 2009.Write a program that reads the contents of the two files into two separatelists, allows a user to input either a girl's name, a boy's name, orboth, then tells the user whether the name(s) was/were popular between 2000 and2009.First, the program should prompt the user to choose a girl's name, a boy's name,or both by entering either 'girl', 'boy', or 'both.'Once they have chosen, they should be able to input a name. If the name wasa popular name, like Jacob or Sophia, the program should print "Jacob was apopular…arrow_forwardCodearrow_forward
- Grade Roster Sort (file I/O) My Solutions The file RosterScores.txt contains student test scores with comma-delimited data similar to what is shown in the screen snip below. Names, Scores Marie Curie, 89 Caroline Herschel, 70 Mary Anning,93 Barbara McCiintock, 99 Dorothy Hodkin, 85 Write a script that loads the data from this file into a table aray variable named Rosterscores and sorts the rows in order of the test scores running highest to lowest. Save the result in a new text file named RosterscoresSorted.txt.arrow_forwardS82A58ipages Student nunber nmber(12) Student _name Varchar2(100) Student_major Number(6) Addrew Varchar2(100) According to the schema and the fellowing Fam design answer the questions STUDENT NUMBER STUDENT NAME SEARCH_BY_NAME The system will Fill the list "Search_By_name"which is belong to "Info" Block with the names for all students when form load event (using explicit cursor with For Loop), the return values from this list will be the student number 7 Note Give the names of the Triggers wil be usrearrow_forwardHi All, Please help me with this question. Employee Registry This project requires the use of an employees.dat file (create your own file). The record format in the file is listed below (separated by a single space): first_name last_name employee_id phone_number Overview You’ve been asked by your employer to create an employee registry program. The program will be used by the HR department to maintain employee records. Requirements When your program starts, it should read the employees.dat file into memory. A menu should be displayed like below. List all employee details List employee by last name Add a new employee Remove an employee Show all managers only Show all staff only Quit Each menu option should be handled by its own function. You should add utility functions as needed. When option 1 is selected your program should list all the information for each employee in a tabular format. When option 2 is selected your program should prompt the user to enter an employee’s last name. If…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageCOMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE L
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L