Computer Science: An Overview (13th Edition) (What's New in Computer Science)
13th Edition
ISBN: 9780134875460
Author: Glenn Brookshear, Dennis Brylow
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 3.4, Problem 1QE
Explanation of Solution
Drawback to controlling access to the resource:
- The resource can be used once in a process at a time.
- The resource is allocated in a strictly alternating fashion. After the process has used and relinquished the resource, the othe...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
In this assignment, you will implement a simple OS scheduler using C/C++. The scheduler's task is to
receive a set of processes and their details, and then decide the order of executing these processes
based on the chosen algorithm. Finally, the scheduler will output the order of process execution, in
addition to some stats about each of the processes.
The scheduling algorithm chosen for this assignment will be SJF (Shortest Job First). The input will start
with an integer N, representing the number of processes, followed by N lines (one for each process). For
each line i, the line will start with a strings, representing the process name, followed by 2 numbers
representing the arrival time and processing time for the ith process, respectively.
Your program should print a line indicating the order of executing the processes. Then, for each process,
the program should print a line showing the process's name, response time, turnaround time, and delay.
See the sample output below for…
Write a C program that gets a source file name from a user. If the file does not exist, it will generate a proper error and exits.If the file exists, it also gets the name of two more files from the user, say destination1 and destination2. These files don’t need to exist as they are files that need to be written to.
If the files cannot be opened for writing, a proper error will be generated.
The program then reads the source file line by line. It will copy every line that has a digit in it to destination 2 and lines that have no digit in them to destination 1. Feel free to use ctype’s isdigit() function to identify digit characters.
Example:
If source file is:Hi My name is VeriaHello My name is John. How can I help you?I have a problem with my giga bit internet. The speed should be around 1000 but it’s just 200
Sure! I can help with that.
Can I have your number in case we get disconnected?
Sure! My number’s 647-123-1234
First file (destination 1) should be
Hi My name is Veria
Hello…
A dentist office is currently using paper files to manage all office activities. To
make their work easier, the office decided to build a software system to manage
those activities instead of using their old paper-way methods. The office patients
can take their appointments either by phone or by walking in person to the office
lobby. In either way, the receptionist schedules an appointment for the patient with
the desired date and time. The system shall not allow scheduling appointments
with the same doctor for a duration of less than 30 minutes. Of course, the system
shall accept appointments for a specific doctor if the doctor is working on that
time. This means that the system shall keep track of each doctor working schedule.
The office receptionist enters doctors working schedule in the form of working
days for each week. For example, a doctor work schedule can be on Monday,
Wednesday, and Thursday from 9:00 am until 4:00 pm for all weeks until June 01,
2021. Now, the office…
Chapter 3 Solutions
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Ch. 3.1 - Identify examples of queues. In each case,...Ch. 3.1 - Which of the following activities require...Ch. 3.1 - Prob. 3QECh. 3.1 - Prob. 4QECh. 3.2 - Prob. 1QECh. 3.2 - What is the difference between application...Ch. 3.2 - Prob. 3QECh. 3.2 - Prob. 4QECh. 3.3 - Summarize the difference between a program and a...Ch. 3.3 - Summarize the steps performed by the CPU when an...
Ch. 3.3 - Prob. 3QECh. 3.3 - If each time slice in a multiprogramming system is...Ch. 3.3 - Prob. 5QECh. 3.4 - Prob. 1QECh. 3.4 - Suppose a two-lane road converges to one lane to...Ch. 3.4 - Prob. 3QECh. 3.4 - Prob. 4QECh. 3.5 - Prob. 1QECh. 3.5 - Prob. 2QECh. 3.5 - If a process in a multiprogramming system could...Ch. 3 - List four activities of a typical operating...Ch. 3 - Summarize the distinction between batch processing...Ch. 3 - Prob. 3CRPCh. 3 - Prob. 4CRPCh. 3 - What is a multitasking operating system?Ch. 3 - Prob. 6CRPCh. 3 - On the basis of a computer system with which you...Ch. 3 - a. What is the role of the user interface of an...Ch. 3 - What directory structure is described by the path...Ch. 3 - Define the term process as it is used in the...Ch. 3 - Prob. 11CRPCh. 3 - What is the difference between a process that is...Ch. 3 - What is the difference between virtual memory and...Ch. 3 - Suppose a computer contained 512MB (MiB) of main...Ch. 3 - What complications could arise in a...Ch. 3 - What is the distinction between application...Ch. 3 - Prob. 17CRPCh. 3 - Summarize the booting process.Ch. 3 - Why is the booting process necessary?Ch. 3 - If you have a PC, record the sequence activities...Ch. 3 - Suppose a multiprogramming operating system...Ch. 3 - Prob. 22CRPCh. 3 - Prob. 23CRPCh. 3 - Prob. 24CRPCh. 3 - Prob. 25CRPCh. 3 - Would greater throughput be achieved by a system...Ch. 3 - Prob. 27CRPCh. 3 - What information is contained in the state of a...Ch. 3 - Identify a situation in a multiprogramming system...Ch. 3 - List in chronological order the major events that...Ch. 3 - Prob. 31CRPCh. 3 - Prob. 32CRPCh. 3 - Explain an important use for the test-and-set...Ch. 3 - Prob. 34CRPCh. 3 - Prob. 35CRPCh. 3 - Prob. 36CRPCh. 3 - Prob. 37CRPCh. 3 - Each of two robot arms is programmed to lift...Ch. 3 - Prob. 39CRPCh. 3 - Prob. 40CRPCh. 3 - Prob. 41CRPCh. 3 - Prob. 42CRPCh. 3 - Prob. 43CRPCh. 3 - Prob. 44CRPCh. 3 - Prob. 45CRPCh. 3 - Prob. 46CRPCh. 3 - Prob. 47CRPCh. 3 - Prob. 48CRPCh. 3 - Prob. 49CRPCh. 3 - Prob. 50CRPCh. 3 - Prob. 51CRPCh. 3 - Prob. 52CRPCh. 3 - How is the window manager related to the operating...Ch. 3 - Prob. 54CRPCh. 3 - Prob. 55CRPCh. 3 - Suppose you are using a multiuser operating system...Ch. 3 - Prob. 2SICh. 3 - Prob. 3SICh. 3 - Prob. 4SICh. 3 - Prob. 5SI
Knowledge Booster
Similar questions
- A common problem in health informatics is to read a message from another healthcare organization and to parse it to extract the relevant information. In practice, this is a very large problem. However, to get you started thinking in this area, consider receiving a simple message from another organization in the form <<&first name&&last name&&age in years&&medical record number&&diagnosis&>> Your organization needs to read such a message and extract out the five information elements. To do so, it needs to develop a program to accomplish this. Your assignment is to develop pseudocode to accomplish this task. As an example, if the input is: <<&Tom&&Smith&&25&&12345&&pneumonia&>> then you should output the following: First Name: Tom Last Name: Smith Age: 25 Medical Record Number: 12345 Diagnosis: pneumoniaarrow_forwardWrite code in c++ and Dont use string . Use #include<iostream> header file only.arrow_forwardJava only Design, implement and test a Java class that processes a series of triangles. For this assignment, triangle data will be read from an input file and the program’s output will be written to another file. The output file will also include a summary of the data processed. You must use at least one dialog box in this program. The data for each triangle will be on a separate line of the input file, with the input data echoed and the results referred to by the line number (see example). On initialization, the program will prompt the user for both an input and an output file. If a non-existent input file is specified, the appropriate exception must be handled, resulting in an error message. For the exception case, re-prompt the user for the correct input file. Once the I/O file is specified, the program will read in and process all the entries in the file. The output of the program will be written to the specified output file and echoed to the console. The program will…arrow_forward
- Computer Science A system call in an operating system is typically a function call that traps to the kernel. However, there are also library calls that are functions that do not directly trap into the kernel, but may invoke system calls that do. In MINIX, there is a corresponding library call read that always invokes the system call. In UNIX, there are also several other library calls---getc, fgetc, getchar, for example---that also input data. Describe the difference between the MINIX read library call and these functions. How do you think these functions (getc, fgetc, getchar) perform data input? Do they always need to ultimately trap to the kernel? Why or why not?arrow_forwardWRITE 2 C FILE In this assignment you are required to follow the Unix domain server and client example done in the classroom. After this point, you need to setup the server in a way that it will process the data sent by the client and send back the processed data. You must read at least two set of data, and send back at least a piece of information. For instance, client might send two numbers and the server will send the summation back. This is only an example, please do something a little more complicated. I do not want to see same operation over and over again in the assignments. You can use scanf and printf with dup2 to obtain numbers. Alternatively, you could read the text and use sscanf and sprintf. You could also perform text based operations. It is up to you. You must perform all error checks.arrow_forwardIn any available programming language, write a program that imitates the process scheduler of the operating system. The program must contain the following functions: Помощь Русский (ru) ~ edu@SUSU • adding hew processes, • input data about the new process; • view of information about the system time; • choice of the scheduling algorithm. Август Лоуренс Processes are modeled by the program as some data structures. There is no need to create and track real processes. You need to select 2 algorithms from the list below and implement a process scheduling mechanism. In addition, it is necessary to develop a set of tests that demonstrate the advantages and disadvantages of a given scheduling algorithm. For example, for a priority scheduling algorithm with static priorities, a situation should be tested when a process with a low priority cannot enter the execution state for a long time. Options: 1. FCFS 2. RR 3. SJF non-displacement 4. SJF displacing 5. HRN planning 6. Priority planning is…arrow_forward
- Write the mnemonics of the following program: The pressure of two boilers is monitored and controlled by a microcomputer works based on microprocessor programming. A set of 6 readings of first boiler, recorded by six pressure sensors, which are stored in the memory location starting from 2050H. A corresponding set of 6 reading from the second boiler is stored at the memory location starting from 2060H. Each reading from the first set is expected to be higher than the corresponding position in the second set of readings. Write an 8085 sequence to check whether the first set of reading is higher than the second one or not. If all the readings of first set is higher than the second set, store 00 in the ‘D’ register. If any one of the readings is lower than the corresponding reading of second set, stop the process and store FF in the register ‘D’. Data (H): First set: 78, 89, 6A, 80, 90, 85 Second Set:71, 78, 65, 89, 56, 75arrow_forwardIN C++: Semaphores are used to mediate access to computer resources. Your task is to write a program that uses semaphores to simulate mediated access to three computer resources: 5 printers 6 plotters 4 scanners Your program shall: Declare and initialize the semaphores with the appropriate values. Create a routine that loops through a sequence 4 times. In each iteration the process forks a child process.The child process: uses a random number generator (1-3) to determine which resource it will request uses native semaphore function or one that you create to request the appropriate resource Print the process’ PID and the requested resource type Print the process’ PID and the success/failure of the request if the resource is available - sleep for a random time between 1-3 seconds and then release the resource using appropriate the semaphore function if the resource is not available – sleep for a random between 2-4 seconds and repeat the request (go to step ii). Terminate Sleeps…arrow_forwardPlease answer this in C Task 2: GPA analysis 1. Open a C editor and create a new file called task2.c. 2. You want to write a C program that analyzes students’ GPA. If the GPA is greater than or equal to 3.9, the student makes the dean’s honor list. If the GPA is less than 2.00, the student is sent a warning letter indicating that the GPA is below the graduation requirement.arrow_forward
- Assume you have been asked to use Equivalence Partitioning method to check the ATM machine login function regarding to PIN number validation. Here are some detailed requirements:Users must use valid ATM card and enter a correct PIN number to access their accounts. Otherwise, a rejection message will be displayed to them. Here are some specification descriptions relating to a valid PIN number. Each valid PIN number must be formed with letters (‘a’ to ‘z) and digitals Each PIN must include at least one up-case letter and one lower-case letter. Each PIN is acceptable if it includes one special chars from the following list:o !, #, @, $ The length of each valid PIN must be in the range from 8 to 12.Whenever an invalid PIN is entered, one of following messages will be displayed:“Incorrect Password” - This suggests that a PIN (entered by a user) is valid but not correct. “Invalidated Password”- This suggests that a PIN (entered by a user) is invalid.a) Please list your identified…arrow_forwardDevelop a program in C to create three processes A, B and C. Job of these individual processes are as follows: Process A: Reads n numbers from the keyboard and counts the number of odd numbers in it. Then this count will be sent to the Process B. Process B: Reads the count from Process A and determines the fibonacci sequence of that count. This fibonacci sequence result will be sent to the process C. Process C: This process reads the fibonacci sequence from process B and sort the numbers in descending order.arrow_forwardA supermarket needs to develop the following software to encourage regular customers. For this, the customer needs to supply his/her residence address, telephone number, and the driving license number. Each customer who registers for this scheme is assigned a unique customer number (CN) by the computer. A customer can present his CN to the check out staff when he makes any purchase. In this case, the value of his purchase is credited against his CN. At the end of each year, the supermarket intends to award surprise gifts to 10 customers who make the highest total purchase over the year. Also, it intends to award a 22 caret gold coin to every customer whose purchase exceeded Rs.10,000. The entries against the CN are the reset on the day of every year after the prize winners’ lists are generated. Generate a level 0, level I and level 2 DFD.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Operations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks ColeC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning