Create a Python program to perform this task like multithreading and synchronization, to make this process run faster?
Added by Elizabeth H.
Step 1
Let's think step by step. Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 83 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Your program must take in a list of dependent tasks and output a valid order in which to perform them. Your program will accept a number of lines of textual input (via standard input). Do not open a named file. Instead, always read from standard input. That text input will contain a non-zero but even number of lines. Every two lines represent a pair of tasks. The first line gives the name of a task, the second line gives the name of a task that it depends on. This text input is also called the task list. The task list will contain only standard ASCII characters (no UTF-8 Unicode or special accents). The goal is to test programming and program language concepts, not your internationalization abilities. Each task name starts at the beginning of the line and extends all the way up to (but not including) the end of that line. So, the newline or carriage return characters, or , are not part of the task name. Each task name is at most 60 characters long. (This limit is to make implementation faster and easier.) Example task list: learn Cool read the Cool tutorial do Project learn Cool The interpretation is that in order to learn Cool one must first read the Cool tutorial and that in order to do Project one must first learn Cool. Desired output for this example: read the Cool tutorial learn Cool do Project You must turn in a zip file containing two source files. Use the following names: task-organizer.cl — Cool implementation task-organizer.py — Python implementation testcase.txt — a valid task list that you made up. readme.txt — your README file The readme.txt file should be a plain ASCII text file (not a Word file, not an RTF file, not an HTML file) describing your design decisions. Which language did you start with? Which language was the hardest? One or two English paragraphs should suffice.
Akash M.
Create a Python program that prompts a user to enter the names and finish times of three competitors in a race. Based on the finish times, your program will then determine and print who won the gold, silver, and bronze medals. Your program should reject any entered times less than or equal to zero by continuing to prompt for new input until a valid time has been entered.???
Liam H.
A. Use the Java language for this project. Objectives: This programming project is to simulate the CPU scheduling algorithms, bankers algorithm, and page replacement algorithms discussed in class. You will write a program to implement a simulator with different algorithms. The program outputs a menu to the user, where the user selects his/her choice from the menu. In the case of CPU scheduling algorithms, the simulator selects a task to run from the ready queue based on the scheduling algorithm. Since the project intends to simulate a CPU scheduler, it does not require any actual process creation or execution. When a task is scheduled, the simulator will simply print out what task is selected to run at a time. It outputs in a way similar to a Gantt chart style. Other choices will be treated as discussed in class. The user can run any algorithm. B. Project Descriptions: The selected scheduling algorithms to implement in this project are: 1. First Come First Serve (FCFS) 2. Non-preemptive shortest job first 3. Preemptive shortest job first 4. Round Robin 5. Bankers Algorithm 6. First in First out (FIFO) 7. Least recently used 8. Optimal 9. Exit C. Requirements: I. The project requires simulating FCFS, SJF preemptive and non-preemptive, and the RR scheduling for given tasks by reading: 1. The number of processes. 2. The arrival time for each process, indicate 0 for not given arrival time. 3. The Burst time for each process. You are required to compute: 1. The average waiting time for each process. 2. The average waiting time. 3. The turnaround time for each process. 4. The average turnaround time. 5. Draw the Gantt Chart II. The project requires simulating the Bankers algorithm by reading: 1. The number of processes (n) 2. The number of resources (m) 3. The number of instances for each resource 4. The Allocation Matrix (row by row) 5. The Max Matrix (row by row) 6. The available vector You are required to compute: 1. The Need Matrix 2. In order to enter the safe state, print the sequence of processes which satisfy the safety criteria. 3. Ask the user if a request can be granted or not. If yes, show the changes in the matrices if any. III. The project requires simulating the page replacement algorithm either, FIFO, Optimal, or LRU by reading: 1. The size of the frame. 2. The reference strings. You are required to compute: 1. Number of page faults 2. Both hit and miss ratio
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD