function in C using nested for loops?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

How would I write the memory management function in C using nested for loops?

v. Write decision making logic based on the value of the
looping variable (i.e. algorithm)
1. When algorithm is equal to FIRST, call
function firstFit, passing arguments blockSize,
blocks, processSize, and processes
2. When algorithm is equal to BEST, call
function bestFit, passing arguments blockSize,
blocks, processSize, and processes
3. When algorithm is equal to WORST, call
function worstFit, passing arguments
blockSize, blocks, processSize, and processes
4. When algorithm is equal to NEXT, call
function nextFit, passing arguments blockSize,
blocks, processSize, and processes
Transcribed Image Text:v. Write decision making logic based on the value of the looping variable (i.e. algorithm) 1. When algorithm is equal to FIRST, call function firstFit, passing arguments blockSize, blocks, processSize, and processes 2. When algorithm is equal to BEST, call function bestFit, passing arguments blockSize, blocks, processSize, and processes 3. When algorithm is equal to WORST, call function worstFit, passing arguments blockSize, blocks, processSize, and processes 4. When algorithm is equal to NEXT, call function nextFit, passing arguments blockSize, blocks, processSize, and processes
preprocessor
main
memory Management
2. Add function prototype for functions
memoryManagement
b. displayProcess
c. firstFit
d. worstFit
e. bestFit
f. nextFit
3. Update the main function to do the following
a. Update decision making logic to determine which OS function
to run based on the following
1 = call function memoryManagement
4. Write function memoryManagement to do the following
a. Return type void
b.
c.
d.
Empty parameter list
Call function clearScreen
Write a looping construct to loop for each of the four memory
management algorithms
i. Declare a one-dimensional array, data type integer, to
store the sizes of the memory blocks (i.e. blockSize)
initialized with values 80, 10, 65, 35, 70
ii. Declare a one-dimensional array, data type integer, to
store the sizes of the processes (i.e. processSize)
initialized with values 25, 70, 5, 45, 60
iii.
iv.
Declare a variable, data type integer, to store the
number of blocks (i.e. blocks)
Declare a variable, data type integer, to store the
number of processes (i.e. processes)
Transcribed Image Text:preprocessor main memory Management 2. Add function prototype for functions memoryManagement b. displayProcess c. firstFit d. worstFit e. bestFit f. nextFit 3. Update the main function to do the following a. Update decision making logic to determine which OS function to run based on the following 1 = call function memoryManagement 4. Write function memoryManagement to do the following a. Return type void b. c. d. Empty parameter list Call function clearScreen Write a looping construct to loop for each of the four memory management algorithms i. Declare a one-dimensional array, data type integer, to store the sizes of the memory blocks (i.e. blockSize) initialized with values 80, 10, 65, 35, 70 ii. Declare a one-dimensional array, data type integer, to store the sizes of the processes (i.e. processSize) initialized with values 25, 70, 5, 45, 60 iii. iv. Declare a variable, data type integer, to store the number of blocks (i.e. blocks) Declare a variable, data type integer, to store the number of processes (i.e. processes)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
ADT and Class
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.
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education