COMPUTER SYSTEMS&MOD MSGT/ET SA AC PKG
3rd Edition
ISBN: 9780134671123
Author: Bryant
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 10, Problem 10.8HW
Write a version of the statcheck program in Figure 10.10, called fstatcheck that takes a descriptor number on the command line rather than a filename.
______________________________________________________________code/io/statcheck c
______________________________________________________________code/io/statcheck c
Figure 10.10 Querying and manipulating a file's st_mode bits.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Write an address book program that stores your contacts' names and their email addresses. The names and email addresses are originally stored in a file called phonebook.in, in the format: Harry Potter t..d@hogwarts.edu Hermione Granger b..h@hogwarts.edu Ron Weasley r..b@hogwarts.edu Draco Malfoy m..s@hogwarts.edu Severus Snape h..e@hogwarts.edu Albus Dumbledore a..x@hogwarts.edu Your program should read from the file, storing the names and corresponding email addresses in a dictionary as key-value pairs. Then, the program should display a menu that lets the user enter the numbers 1 through 5, each corresponding to a different menu item: 1) look up an email address 2) add a new name and email address 3) change an email address 4) delete a name and email address 5) save address book and exit When the user enters 1, the program should prompt them for a name, and then print the corresponding email address. If there is no dictionary entry under that name, the program should print, "Sorry,…
Unix-based operating systems usually include a tool named tail. It displays the last 10 lines of a file whose name is provided as a command line argument. Write a Java program that provides the same behavior i.e. the user can specify how many lines to print from the terminal. Display an appropriate error message if the file requested by the user does not exist, or if the command line argument is omitted.
Note: Make sure to display the last n lines of a file whose name is provided as a command line argument. You might need to pass a file as an argument, therefore make sure to have access to a sample file, the contents of which you want to print out.
Write a program that simulates a paging system using the aging algorithm. The number of page frames is a parameter. The sequence of page references should be read from a file. For a given input file, plot the number of page faults per 1000 memory references as a function of the number of page frames available.
Code Solution:
https://github.com/preethikandhalu/C/blob/master/aging.c
Task to be done based on the above program:
Describe what the code does, explaining how it accomplishes its task of implementing the aging page replacement algorithm.
You must create an input file for simulating a sequence of page references. Run the program. (Fix any bugs that it may contain, first). Vary the number of page frames, keeping the sequence of page references constant. What can you infer from the results?
Plot the output in an Excel graph. Explain your findings. Adjust your inputs to get meaningful outputs.
Chapter 10 Solutions
COMPUTER SYSTEMS&MOD MSGT/ET SA AC PKG
Ch. 10.3 - Prob. 10.1PPCh. 10.8 - Practice Problem 10.2 (solution page 915) Suppose...Ch. 10.8 - Practice Problem 10.3 (solution page 915) As...Ch. 10.9 - Prob. 10.4PPCh. 10.9 - Practice Problem 10.5 (solution page 916) Assuming...Ch. 10 - Prob. 10.6HWCh. 10 - Prob. 10.7HWCh. 10 - Write a version of the statcheck program in Figure...Ch. 10 - Consider the following invocation of the...Ch. 10 - Prob. 10.10HW
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Suppose number is a variable of type int. Write an if-else statement that outputs the word "Positive" if the va...
Absolute Java (6th Edition)
This is automatically provided for a class if you do not write one yourself. a. accessor method b. default inst...
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
What limitation does a static member function have?
Starting Out with C++: Early Objects
Describe the role of data dictionary in the management and maintenance of a database.
Modern Database Management
The spreadsheet in Microsoft Excel file Ch01Ex01_U10e.xlsx contains records of employee activity on special pro...
Using MIS (10th Edition)
This key word is used to declare a named constant. a. constant b. namedConstant c. final d. concrete
Starting Out with Java: From Control Structures through Objects (6th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write a C/C++ language program on Linux that creates an array of 10,000 random unsigned integers in the range 1 to 1,000,000. These integers are then stored in a text file called numbers.txt Part 2: Write a C/C++ language program on Linux that reads the file numbers.txt and checks each number for being a prime number. Only the prime numbers from these are then written to a text file prime.txt. Part 3: Modify the program of part 2 so that it takes an input argument num_jobs with a value between 1 and 8. E.g. if num_jobs is 3, it splits into 3 parallel processes using fork() function and each process then calculates prime numbers from a subset of the input data. Together these 3 jobs find prime numbers from all the 10,000 input integers. The overall parent process then combines the results from its children into a single file prime.txt Part 4: Calculate the times taken by running the program of part 3, and make a table where the time taken for calculation is given for each value of…arrow_forwardObjdump can disassemble programs like a.out, but not binary object files like src.o.arrow_forwardUnix-based operating systems usually include a tool named tail. It displays the last 10 lines of a file whose name is provided as a command line argument. Write a Java program that provides the same behavior i.e. the user can specify how many lines to print from the terminal. Display an appropriate error message if the file requested by the user does not exist, or if the command line argument is omitted.arrow_forward
- Hi, I am trying to learn and execute a morse code in this way and by using this format, I already know another way and it works but it will be very helpful to understand this one as well, thanks. def print_intro(): def get_input(): def encode(message): def decode(message): def process_lines(filename, mode): def write_lines(lines): def check_file_exists(filename): def main():arrow_forwardWrite a C program, called reverse, using standard I/O functions, to take a file as inputthen copies it to another file in reverse order. That is, the last byte becomes the first,the byte just before the last one becomes the second, etc.The program call should look like:reverse fileIn fileOutSubmit your source code and script filesarrow_forwardWrite a Java GUI program using BufferedReader that asks the user to input the file to be opened. If said file exists, the program shows its first line text. It is given that you have myFile.txt in your working directory with the following text. Sample Output:arrow_forward
- Java Program ASAP ************This program must work in hypergrade and pass all the test cases.********** I have provided the code instructions and the text files below. The test cases are located in Hypergrade. Down below is a working code. Dont add any import libraries in the program just modify the rest of the code so it passes the test cases. import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.HashMap;import java.util.Map;import java.util.Scanner;public class MorseCodeConverter { public static void main(String[] args) { Map<String, String> morseCodeMap = readMorseCodeTable("morse.txt"); Scanner scanner = new Scanner(System.in); System.out.print("Please enter the file name or type QUIT to exit:\n"); do{ String fileName = scanner.nextLine().trim(); if (fileName.equalsIgnoreCase("QUIT")) { break; } try { String…arrow_forwardWrite a bash program that takes in a word and a filename from the command line and print out the number of occurrences of the word in the file. Name the program count_word.sh. Your program should work as follow:hb117@uxb5:~$ ./count_word.sh global /home/hb117/shared/cs371/lab04/global.txt global 9 hb117@uxb5:~$ ./count_word.sh nuclear /home/hb117/shared/cs371/lab04/global.txt hb117@uxb5:~$ add awk to your pipearrow_forwardUse EMACS to correct the script below: ################################################ Favorite Food# Repair this script# Enters Fish & Chips# Bring about a file with the food name and the calculation in the file: foods# Date: 03/31/2022# Note: this script has errors... please repair them!################################################## ask the user what their favorite food isecho -n "What do I like to eat? "# Read in the estimateread estimate## Set calculation to zerocalculation=999Utilize a while loop to read in the food name until "Fish & Chips" is entered#while test $foodname != "Fish & Chips" ; do## add one to calculation let calculation=calculation+1## write out the food to a file called foods echo "$estimate:$calculation" >> echo $estimate "Nope, try again! "; read estimatedonearrow_forward
- Task 3: Measure the Entropy of Kernel In the virtual world, it is difficult to create randomness, i.e., software alone is hard to create random numbers. Most systems resort to the physical world to gain the randomness. Linux gains the randomness from the following physical resources: void add_keyboard_randomness(unsigned char scancode); void add_mouse_randomness(__u32 mouse_data); void add_interrupt_randomness(int irq); void add_blkdev_randomness(int major); The first two are quite straightforward to understand: the first one uses the timing between key presses; the second one uses mouse movement and interrupt timing; the third one gathers random numbers using the interrupt timing. Of course, not all interrupts are good sources of randomness. For example, the timer interrupt is not a good choice, because it is predictable. However, disk interrupts are a better measure. The last one measures the finishing time of block device requests. The randomness is measured using entropy, which is…arrow_forwardWrite a C program which creates a child process to find all txt files in the root directory (i.e., “/") and stores the output in a text file called “all_txt_files.txtť". If the child process execution takes more than t seconds (measured at the parent), the parent should abort the execution of that child. Otherwise, after the child process termination, the parent has to create another child which will count the number of records in all_txt_files.txt and print out the output. The program should not allow the creation of orphan processes. - You need to include the C header file time.h to roughly count the execution time of the child process and play with different values of t so that both cases may happen. Another option may be the alarm system call. - You can use redirection (i.e., “>") to redirect the output of find to a txt file (e.g., find / - name "*. txt" > all_txt_files.txt). It's not a problem if find cannot access some directories. - You can count the number of lines in a txt…arrow_forwardWhen you compile and run packaged software from an IDE, the execution process can be as easy as clicking a run icon, as the IDE will maintain the classpath for you and will also let you know if anything is out of sorts. When you try to compile and interpret the code yourself from the command line, you will need to know exactly how to path your files. Let us start from c:\Code directory for this assignment. Consider a java file who's .class will result in the com.CITC1318.course package as follows: package com.CITC1318.course; public class GreetingsClass { public static void main(String[] args) { System.out.println("$ Greetings, CITC1318!"); } } This exercise will have you compiling and running the application with new classes created in a separate package: 1. Compile the program: c:\Code>javac -d . GreetingsClass.java 2. Run the program to ensure it is error-free: c:\Code>java -cp . com.CITC1318.course.GreetingsClass 3. Create three classes named Chapter1, Chapter2, and Chapter3…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- 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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Linux - Tutorial for Beginners in 13 MINUTES! [ UPDATED ]; Author: bai;https://www.youtube.com/watch?v=BMGixkvJ-6w;License: Standard YouTube License, CC-BY
What is Linux?; Author: Techquickie;https://www.youtube.com/watch?v=zA3vmx0GaO8;License: Standard YouTube License, CC-BY
Introduction to Linux and Basic Linux Commands for Beginners; Author: sakitech;https://www.youtube.com/watch?v=IVquJh3DXUA;License: Standard Youtube License