SlideShare a Scribd company logo
Write this in C language.
This project will require students to simulate the behaviors of an operating system with a series
of
assignments.
1. Simulate process allocation to memory blocks based on memory management algorithms
First
Fit, Best Fit, Next Fit, and Worst Fit.
2. Simulate file management of directories and files stored in a directory.
3. Simulate multi-threaded programming with the POSIX (Portable Operating System Interface)
threads (a.k.a. pthreads).
C programming language integrated development environment (IDE)
1. Code::Blocks ~ NOT Mac compatible
2. Visual Studio Code
3. Atom
4. https://replit.com/
5. XCode
Assignment Scope: Memory Management
1. First Fit Implementation:
a. Input memory blocks with size and processes with size.
b. Initialize all memory blocks as free.
c. Start by picking each process and check if it can be assigned to current block.
d. If size-of-process <= size-of-block if yes then assign and check for next process.
e. If not then keep checking the further blocks.
2. Best Fit Implementation:
a. Input memory blocks with size and processes with size.
b. Initialize all memory blocks as free.
c. Start by picking each process and find the minimum block size that can be assigned to
current process i.e., find min(blockSize[1], blockSize[2],.....blockSize[n]) >
processSize[current], if found then assign it to the current process.
d. If not, then leave that process and keep checking the further processes.
3. Worst Fit Implementation:
a. Input memory blocks with size and processes with size.
b. Initialize all memory blocks as free.
c. Start by picking each process and find the maximum block size that can be assigned to
current process i.e., find max(blockSize[1], blockSize[2],.....blockSize[n]) >
processSize[current], if found then assign it to the current process.
d. If not, then leave that process and keep checking the further processes.
4. Next Fit Implementation:
a. Input memory blocks with size and processes with size.
b. Initialize all memory blocks as free.
c. Start by picking each process and check if it can be assigned to the current block, if yes,
allocate it the required memory and check for next process but from the block where we
left not from starting.
d. If the current block size is smaller, keep checking the further blocks.
Tasks
Activity
OSManagement.c 1. Update source code file OSManagement.c
preprocessor 2. Add function prototype for functions
a. memoryManagement
b. displayProcess
c. firstFit
d. worstFit
e. bestFit
f. nextFit
main 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
a. 1 = call function memoryManagement
memoryManagement 4. Write function memoryManagement to do the following
a. Return type void
b. Empty parameter list
c. Call function clearScreen
d. 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. Declare a variable, data type integer, to store the
number of blocks (i.e. blocks)
iv. Declare a variable, data type integer, to store the
number of processes (i.e. processes)
3
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
nextFit 5. Write function nextFit to do the following
a. Return type void
b. Parameter list includes
i. One-dimensional array, data type integer, contains the
block sizes (i.e. blockSize)
ii. Parameter contains the number of blocks, data type
integer (i.e. blocks)
iii. One-dimensional array, data type integer, contains the
process sizes (i.e. processSize)
iv. Parameter contains the number of processes, data type
integer (i.e. processes)
c. Declare a one-dimensional array, data type integer, to store the
block id that a process is allocated to (i.e. allocation), size is
parameter processes
d. Declare a variable, data type integer, to store the block
allocation for a process, initialize to 0 (i.e. id)
e. Call function memset, passing arguments
i. Array allocation
ii. -1 (i.e. INVALID)
iii. sizeof(allocation)
f. Using a looping construct, loop through the number of
processes
i. Using a looping construct, loop while id is less than
the number of blocks
1. If the current block size (i.e. index id) is greater
than or equal to the current process size (i.e.
index of outer looping variable)
a. Update the allocation array to set the
element at index of the outer looping
variable equal to variable id
b. Reduce available memory of the current
block size (i.e. index id) by the process
4
size (i.e. index of the outer looping
variable)
c. break out of the inner loop
ii. Update the value of variable id to set the next index in
array blockSize by adding 1 to variable id then
modulus the total by the number of blocks
g. Call function displayProcess passing arguments allocation,
processes, and processSize
firstFit 6. Write function firstFit to do the following
a. Return type void
b. Parameter list includes
i. One-dimensional array, data type integer, contains the
block sizes (i.e. blockSize)
ii. Parameter contains the number of blocks, data type
integer (i.e. blocks)
iii. One-dimensional array, data type integer, contains the
process sizes (i.e. processSize)
iv. Parameter contains the number of processes, data type
integer (i.e. processes)
c. Declare a one-dimensional array, data type integer, to store the
block id that a process is allocated to (i.e. allocation), size is
parameter processes
d. Call function memset, passing arguments
i. Array allocation
ii. -1 (i.e. INVALID)
iii. sizeof(allocation)
e. Using a looping construct, loop through the number of
processes
i. Using a looping construct, loop the number of blocks
1. If the current block size (i.e. index of the inner
looping variable ) is greater than or equal to the
current process size (i.e. index of outer looping
variable)
a. Update the allocation array to set the
element at index of the outer looping
variable equal to the inner looping
variable
b. Reduce available memory of the current
block size (i.e. index of the inner
looping variable) by the process size
(i.e. index of the outer looping variable)
c. break out of the inner loop
f. Call function displayProcess passing arguments allocation,
processes, and processSize
5
bestFit 7. Write function bestFit to do the following
a. Return type void
b. Parameter list includes
i. One-dimensional array, data type integer, contains the
block sizes (i.e. blockSize)
ii. Parameter contains the number of blocks, data type
integer (i.e. blocks)
iii. One-dimensional array, data type integer, contains the
process sizes (i.e. processSize)
iv. Parameter contains the number of processes, data type
integer (i.e. processes)
c. Declare a one-dimensional array, data type integer, to store the
block id that a process is allocated to (i.e. allocation), size is
parameter processes
d. Call function memset, passing arguments
i. Array allocation
ii. -1 (i.e. INVALID)
iii. sizeof(allocation)
e. Using a looping construct, loop through the number of
processes
i. Declare a variable, data type integer, to store the
current best fit value (i.e. bestIdx) initialized to -1 (i.e.
INVALID)
ii. Using a looping construct, loop the number of blocks
1. If the current block size (i.e. index of the inner
looping variable ) is greater than or equal to the
current process size (i.e. index of outer looping
variable)
a. If the value of bestIdx is equal to -1
(i.e. INVALID)
i. Set variable bestIdx equal to the
current block (i.e. the inner
looping variable)
b. Else if the value of the block size at
index bestIdx is greater than the value
of the block size at index of the inner
looping variable
i. Set variable bestIdx equal to the
current block (i.e. the inner
looping variable)
iii. If the value of variable bestIdx is not equal to -1 (i.e.
INVALID)
1. Update the allocation array to set the element
at index of the outer looping variable equal to
variable bestIdx
6
2. Reduce available memory of the current block
size (i.e. index bestIdx) by the process size (i.e.
index of the outer looping variable)
f. Call function displayProcess passing arguments allocation,
processes, and processSize
worstFit 8. Write function worstFit to do the following
a. Return type void
b. Parameter list includes
i. One-dimensional array, data type integer, contains the
block sizes (i.e. blockSize)
ii. Parameter contains the number of blocks, data type
integer (i.e. blocks)
iii. One-dimensional array, data type integer, contains the
process sizes (i.e. processSize)
iv. Parameter contains the number of processes, data type
integer (i.e. processes)
c. Declare a one-dimensional array, data type integer, to store the
block id that a process is allocated to (i.e. allocation), size is
parameter processes
d. Call function memset, passing arguments
i. Array allocation
ii. -1 (i.e. INVALID)
iii. sizeof(allocation)
e. Using a looping construct, loop through the number of
processes
i. Declare a variable, data type integer, to store the
current worst fit value (i.e. wstIdx) initialized to -1
(i.e. INVALID)
ii. Using a looping construct, loop the number of blocks
1. If the current block size (i.e. index of the inner
looping variable ) is greater than or equal to the
current process size (i.e. index of outer looping
variable)
a. If the value of wstIdx is equal to -1 (i.e.
INVALID)
i. Set variable wstIdx equal to the
current block (i.e. the inner
looping variable)
b. Else if the value of the block size at
index wstIdx is less than the value of
the block size at index of the inner
looping variable
i. Set variable wstIdx equal to the
current block (i.e. the inner
looping variable)
7
iii. If the value of variable wstIdx is not equal to -1 (i.e.
INVALID)
1. Update the allocation array to set the element
at index of the outer looping variable equal to
variable wstIdx
2. Reduce available memory of the current block
size (i.e. index wstIdx) by the process size (i.e.
index of the outer looping variable)
f. Call function displayProcess passing arguments allocation,
processes, and processSize
displayProcess 9. Write function displayProcess to do the following
a. Return type void
b. Parameter list includes
i. One-dimensional array, data type integer, that stores
the block number allocations (i.e. allocation)
ii. Parameter that contains the number of processes, data
type integer (i.e. processes)
iii. One-dimensional array, data type integer, that stores
the processes (i.e. processSize)
c. Write a looping construct to loop through the processes (i.e.
processSize)
i. Display to the console the process number (i.e use the
looping variable plus 1)
ii. Display to the console the process size (i.e.
processSize array at the current looping index)
iii. Display to the console the memory block assigned
based on the following logic
1. If the value stored at the current index of array
processSize if -1 (i.e. INVALID), output Not
Allocated
2. Else, output the current allocation (i.e.
allocation)
OSManagement
executable
Test Case 1 Test Case 1 passes
Test Case 2 Test Case 2 passes
Test Case 3 Test Case 3 passes
Test Case 4 Test Case 4 passes
Test Case 5 Test Case 5 passes
Test Case 6 Test Case 6 passes
Test Case 7 Test Case 7 passes
Test Case 8 Test Case 8 passes
Source compiles with no errors
Source compiles with no warnings
Source runs with no errors
8
Source includes comments
Perform the following test cases
Test Cases
Action Expected outcome
Test Case 1 Run executable The executable runs
The output in the command prompt should
be similar to Error! Reference source not
found.
Test Case 2 User enters an invalid
menu option value,
value 2, or value 3
The output in the command prompt should
be similar to Error! Reference source not
found.
Test Case 3 User enters menu
option value 1;
memoryManagement
function
The output in the command prompt should
be similar to Figure 2 memoryManagement
function output
Test Case 4 User enters menu
option value 1;
nextFit function
The output in the command prompt should
be similar to Figure 3 nextFit function output
Test Case 5 User enters menu
option value 1;
firstFit function
The output in the command prompt should
be similar to Figure 4 firstFit function output
Test Case 6 User enters menu
option value 1;
bestFit function
The output in the command prompt should
be similar to Figure 5 bestFit function output
Test Case 7 User enters menu
option value 1;
worstFit function
The output in the command prompt should
be similar to Figure 6 worstFit function
output
Test Case 8 User enters menu
option value 0
End of functionality;

More Related Content

Similar to Write this in C language. This project will require students to si.pdf

matmultHomework3.pdfNames of Files to Submit matmult..docx
matmultHomework3.pdfNames of Files to Submit  matmult..docxmatmultHomework3.pdfNames of Files to Submit  matmult..docx
matmultHomework3.pdfNames of Files to Submit matmult..docx
andreecapon
 
VB_ERROR CONTROL_FILE HANDLING.ppt
VB_ERROR CONTROL_FILE HANDLING.pptVB_ERROR CONTROL_FILE HANDLING.ppt
VB_ERROR CONTROL_FILE HANDLING.ppt
BhuvanaR13
 
Lab 1 Essay
Lab 1 EssayLab 1 Essay
Lab 1 Essay
Melissa Moore
 
Parallel Computing - Lec 4
Parallel Computing - Lec 4Parallel Computing - Lec 4
Parallel Computing - Lec 4
Shah Zaib
 
Interview with Anatoliy Kuznetsov, the author of BitMagic C++ library
Interview with Anatoliy Kuznetsov, the author of BitMagic C++ libraryInterview with Anatoliy Kuznetsov, the author of BitMagic C++ library
Interview with Anatoliy Kuznetsov, the author of BitMagic C++ library
PVS-Studio
 
Why learn Internals?
Why learn Internals?Why learn Internals?
Why learn Internals?
Shaul Rosenzwieg
 
embedded C.pptx
embedded C.pptxembedded C.pptx
embedded C.pptx
mohammedahmed539376
 
Run time storage
Run time storageRun time storage
Run time storage
Rasineni Madhan Mohan Naidu
 
Programming in C sesion 2
Programming in C sesion 2Programming in C sesion 2
Programming in C sesion 2
Prerna Sharma
 
VB Dot net
VB Dot net VB Dot net
VB Dot net
Akber Khowaja
 
(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercises(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercises
Nico Ludwig
 
do it in eclips and make sure it compile Goals1)Be able to.docx
do it in eclips and make sure it compile Goals1)Be able to.docxdo it in eclips and make sure it compile Goals1)Be able to.docx
do it in eclips and make sure it compile Goals1)Be able to.docx
jameywaughj
 
Clustering_Algorithm_DR
Clustering_Algorithm_DRClustering_Algorithm_DR
Clustering_Algorithm_DRNguyen Tran
 
DS-UNIT 1 FINAL (2).pptx
DS-UNIT 1 FINAL (2).pptxDS-UNIT 1 FINAL (2).pptx
DS-UNIT 1 FINAL (2).pptx
prakashvs7
 
Data Structures_Introduction
Data Structures_IntroductionData Structures_Introduction
Data Structures_Introduction
ThenmozhiK5
 
H U F F M A N Algorithm Class
H U F F M A N Algorithm ClassH U F F M A N Algorithm Class
H U F F M A N Algorithm ClassJade Danial
 
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYAChapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
Maulik Borsaniya
 
Sqlmaterial 120414024230-phpapp01
Sqlmaterial 120414024230-phpapp01Sqlmaterial 120414024230-phpapp01
Sqlmaterial 120414024230-phpapp01
Lalit009kumar
 

Similar to Write this in C language. This project will require students to si.pdf (20)

matmultHomework3.pdfNames of Files to Submit matmult..docx
matmultHomework3.pdfNames of Files to Submit  matmult..docxmatmultHomework3.pdfNames of Files to Submit  matmult..docx
matmultHomework3.pdfNames of Files to Submit matmult..docx
 
VB_ERROR CONTROL_FILE HANDLING.ppt
VB_ERROR CONTROL_FILE HANDLING.pptVB_ERROR CONTROL_FILE HANDLING.ppt
VB_ERROR CONTROL_FILE HANDLING.ppt
 
Lab 1 Essay
Lab 1 EssayLab 1 Essay
Lab 1 Essay
 
Qtp questions
Qtp questionsQtp questions
Qtp questions
 
Parallel Computing - Lec 4
Parallel Computing - Lec 4Parallel Computing - Lec 4
Parallel Computing - Lec 4
 
Interview with Anatoliy Kuznetsov, the author of BitMagic C++ library
Interview with Anatoliy Kuznetsov, the author of BitMagic C++ libraryInterview with Anatoliy Kuznetsov, the author of BitMagic C++ library
Interview with Anatoliy Kuznetsov, the author of BitMagic C++ library
 
Why learn Internals?
Why learn Internals?Why learn Internals?
Why learn Internals?
 
embedded C.pptx
embedded C.pptxembedded C.pptx
embedded C.pptx
 
Run time storage
Run time storageRun time storage
Run time storage
 
Programming in C sesion 2
Programming in C sesion 2Programming in C sesion 2
Programming in C sesion 2
 
VB Dot net
VB Dot net VB Dot net
VB Dot net
 
(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercises(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercises
 
do it in eclips and make sure it compile Goals1)Be able to.docx
do it in eclips and make sure it compile Goals1)Be able to.docxdo it in eclips and make sure it compile Goals1)Be able to.docx
do it in eclips and make sure it compile Goals1)Be able to.docx
 
Clustering_Algorithm_DR
Clustering_Algorithm_DRClustering_Algorithm_DR
Clustering_Algorithm_DR
 
Lect1.pptx
Lect1.pptxLect1.pptx
Lect1.pptx
 
DS-UNIT 1 FINAL (2).pptx
DS-UNIT 1 FINAL (2).pptxDS-UNIT 1 FINAL (2).pptx
DS-UNIT 1 FINAL (2).pptx
 
Data Structures_Introduction
Data Structures_IntroductionData Structures_Introduction
Data Structures_Introduction
 
H U F F M A N Algorithm Class
H U F F M A N Algorithm ClassH U F F M A N Algorithm Class
H U F F M A N Algorithm Class
 
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYAChapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
 
Sqlmaterial 120414024230-phpapp01
Sqlmaterial 120414024230-phpapp01Sqlmaterial 120414024230-phpapp01
Sqlmaterial 120414024230-phpapp01
 

More from albert20021

You observe that company A has just paid its most recent dividend D0.pdf
You observe that company A has just paid its most recent dividend D0.pdfYou observe that company A has just paid its most recent dividend D0.pdf
You observe that company A has just paid its most recent dividend D0.pdf
albert20021
 
You notice that, in western society, there is an association of hype.pdf
You notice that, in western society, there is an association of hype.pdfYou notice that, in western society, there is an association of hype.pdf
You notice that, in western society, there is an association of hype.pdf
albert20021
 
You have been hired as a social media consultant to develop social m.pdf
You have been hired as a social media consultant to develop social m.pdfYou have been hired as a social media consultant to develop social m.pdf
You have been hired as a social media consultant to develop social m.pdf
albert20021
 
You have been hired to design a database for the University of Mpuma.pdf
You have been hired to design a database for the University of Mpuma.pdfYou have been hired to design a database for the University of Mpuma.pdf
You have been hired to design a database for the University of Mpuma.pdf
albert20021
 
You have already implemented a lexical analyzer in Assignment #1 and.pdf
You have already implemented a lexical analyzer in Assignment #1 and.pdfYou have already implemented a lexical analyzer in Assignment #1 and.pdf
You have already implemented a lexical analyzer in Assignment #1 and.pdf
albert20021
 
You are given n observations X1, X2, . . . , Xn that are i.i.d. and .pdf
You are given n observations X1, X2, . . . , Xn that are i.i.d. and .pdfYou are given n observations X1, X2, . . . , Xn that are i.i.d. and .pdf
You are given n observations X1, X2, . . . , Xn that are i.i.d. and .pdf
albert20021
 
You decide to put your plan into Microsoft Project for easier manage.pdf
You decide to put your plan into Microsoft Project for easier manage.pdfYou decide to put your plan into Microsoft Project for easier manage.pdf
You decide to put your plan into Microsoft Project for easier manage.pdf
albert20021
 
you cross two individuals that are heterozygous at the R locus. if t.pdf
you cross two individuals that are heterozygous at the R locus. if t.pdfyou cross two individuals that are heterozygous at the R locus. if t.pdf
you cross two individuals that are heterozygous at the R locus. if t.pdf
albert20021
 
You are member of Chens care team. You do not speak Chinese. You fi.pdf
You are member of Chens care team. You do not speak Chinese. You fi.pdfYou are member of Chens care team. You do not speak Chinese. You fi.pdf
You are member of Chens care team. You do not speak Chinese. You fi.pdf
albert20021
 
You are given a phage lysate and a culture of bacterial cells. You a.pdf
You are given a phage lysate and a culture of bacterial cells. You a.pdfYou are given a phage lysate and a culture of bacterial cells. You a.pdf
You are given a phage lysate and a culture of bacterial cells. You a.pdf
albert20021
 
You are assessing a patient for syphilis. 1. What are some of the .pdf
You are assessing a patient for syphilis. 1. What are some of the .pdfYou are assessing a patient for syphilis. 1. What are some of the .pdf
You are assessing a patient for syphilis. 1. What are some of the .pdf
albert20021
 
You are a computer user. In your academic work, your engagement wit.pdf
You are a computer user.  In your academic work, your engagement wit.pdfYou are a computer user.  In your academic work, your engagement wit.pdf
You are a computer user. In your academic work, your engagement wit.pdf
albert20021
 
Write one program with a menu allowing a user to select either an In.pdf
Write one program with a menu allowing a user to select either an In.pdfWrite one program with a menu allowing a user to select either an In.pdf
Write one program with a menu allowing a user to select either an In.pdf
albert20021
 
Write a statement that calls the function OutputAge. in coral code.pdf
Write a statement that calls the function OutputAge. in coral code.pdfWrite a statement that calls the function OutputAge. in coral code.pdf
Write a statement that calls the function OutputAge. in coral code.pdf
albert20021
 
Written Assignments 1. Complete a comparative report on concrete ver.pdf
Written Assignments 1. Complete a comparative report on concrete ver.pdfWritten Assignments 1. Complete a comparative report on concrete ver.pdf
Written Assignments 1. Complete a comparative report on concrete ver.pdf
albert20021
 
Write a MARIE program to allow the user to input 10 integers (positi.pdf
Write a MARIE program to allow the user to input 10 integers (positi.pdfWrite a MARIE program to allow the user to input 10 integers (positi.pdf
Write a MARIE program to allow the user to input 10 integers (positi.pdf
albert20021
 
Write SQL statements to answer the following queriesQ1 List of n.pdf
Write SQL statements to answer the following queriesQ1 List of n.pdfWrite SQL statements to answer the following queriesQ1 List of n.pdf
Write SQL statements to answer the following queriesQ1 List of n.pdf
albert20021
 
Write on the research statistics, surveillance baseline - identify a.pdf
Write on the research statistics, surveillance baseline - identify a.pdfWrite on the research statistics, surveillance baseline - identify a.pdf
Write on the research statistics, surveillance baseline - identify a.pdf
albert20021
 
Write a Recipe website Project Proposal (HTML,CSS)The Project Prop.pdf
Write a Recipe website Project Proposal (HTML,CSS)The Project Prop.pdfWrite a Recipe website Project Proposal (HTML,CSS)The Project Prop.pdf
Write a Recipe website Project Proposal (HTML,CSS)The Project Prop.pdf
albert20021
 
Write in Python please Web Server Python Assignment You will dev.pdf
Write in Python please Web Server Python Assignment You will dev.pdfWrite in Python please Web Server Python Assignment You will dev.pdf
Write in Python please Web Server Python Assignment You will dev.pdf
albert20021
 

More from albert20021 (20)

You observe that company A has just paid its most recent dividend D0.pdf
You observe that company A has just paid its most recent dividend D0.pdfYou observe that company A has just paid its most recent dividend D0.pdf
You observe that company A has just paid its most recent dividend D0.pdf
 
You notice that, in western society, there is an association of hype.pdf
You notice that, in western society, there is an association of hype.pdfYou notice that, in western society, there is an association of hype.pdf
You notice that, in western society, there is an association of hype.pdf
 
You have been hired as a social media consultant to develop social m.pdf
You have been hired as a social media consultant to develop social m.pdfYou have been hired as a social media consultant to develop social m.pdf
You have been hired as a social media consultant to develop social m.pdf
 
You have been hired to design a database for the University of Mpuma.pdf
You have been hired to design a database for the University of Mpuma.pdfYou have been hired to design a database for the University of Mpuma.pdf
You have been hired to design a database for the University of Mpuma.pdf
 
You have already implemented a lexical analyzer in Assignment #1 and.pdf
You have already implemented a lexical analyzer in Assignment #1 and.pdfYou have already implemented a lexical analyzer in Assignment #1 and.pdf
You have already implemented a lexical analyzer in Assignment #1 and.pdf
 
You are given n observations X1, X2, . . . , Xn that are i.i.d. and .pdf
You are given n observations X1, X2, . . . , Xn that are i.i.d. and .pdfYou are given n observations X1, X2, . . . , Xn that are i.i.d. and .pdf
You are given n observations X1, X2, . . . , Xn that are i.i.d. and .pdf
 
You decide to put your plan into Microsoft Project for easier manage.pdf
You decide to put your plan into Microsoft Project for easier manage.pdfYou decide to put your plan into Microsoft Project for easier manage.pdf
You decide to put your plan into Microsoft Project for easier manage.pdf
 
you cross two individuals that are heterozygous at the R locus. if t.pdf
you cross two individuals that are heterozygous at the R locus. if t.pdfyou cross two individuals that are heterozygous at the R locus. if t.pdf
you cross two individuals that are heterozygous at the R locus. if t.pdf
 
You are member of Chens care team. You do not speak Chinese. You fi.pdf
You are member of Chens care team. You do not speak Chinese. You fi.pdfYou are member of Chens care team. You do not speak Chinese. You fi.pdf
You are member of Chens care team. You do not speak Chinese. You fi.pdf
 
You are given a phage lysate and a culture of bacterial cells. You a.pdf
You are given a phage lysate and a culture of bacterial cells. You a.pdfYou are given a phage lysate and a culture of bacterial cells. You a.pdf
You are given a phage lysate and a culture of bacterial cells. You a.pdf
 
You are assessing a patient for syphilis. 1. What are some of the .pdf
You are assessing a patient for syphilis. 1. What are some of the .pdfYou are assessing a patient for syphilis. 1. What are some of the .pdf
You are assessing a patient for syphilis. 1. What are some of the .pdf
 
You are a computer user. In your academic work, your engagement wit.pdf
You are a computer user.  In your academic work, your engagement wit.pdfYou are a computer user.  In your academic work, your engagement wit.pdf
You are a computer user. In your academic work, your engagement wit.pdf
 
Write one program with a menu allowing a user to select either an In.pdf
Write one program with a menu allowing a user to select either an In.pdfWrite one program with a menu allowing a user to select either an In.pdf
Write one program with a menu allowing a user to select either an In.pdf
 
Write a statement that calls the function OutputAge. in coral code.pdf
Write a statement that calls the function OutputAge. in coral code.pdfWrite a statement that calls the function OutputAge. in coral code.pdf
Write a statement that calls the function OutputAge. in coral code.pdf
 
Written Assignments 1. Complete a comparative report on concrete ver.pdf
Written Assignments 1. Complete a comparative report on concrete ver.pdfWritten Assignments 1. Complete a comparative report on concrete ver.pdf
Written Assignments 1. Complete a comparative report on concrete ver.pdf
 
Write a MARIE program to allow the user to input 10 integers (positi.pdf
Write a MARIE program to allow the user to input 10 integers (positi.pdfWrite a MARIE program to allow the user to input 10 integers (positi.pdf
Write a MARIE program to allow the user to input 10 integers (positi.pdf
 
Write SQL statements to answer the following queriesQ1 List of n.pdf
Write SQL statements to answer the following queriesQ1 List of n.pdfWrite SQL statements to answer the following queriesQ1 List of n.pdf
Write SQL statements to answer the following queriesQ1 List of n.pdf
 
Write on the research statistics, surveillance baseline - identify a.pdf
Write on the research statistics, surveillance baseline - identify a.pdfWrite on the research statistics, surveillance baseline - identify a.pdf
Write on the research statistics, surveillance baseline - identify a.pdf
 
Write a Recipe website Project Proposal (HTML,CSS)The Project Prop.pdf
Write a Recipe website Project Proposal (HTML,CSS)The Project Prop.pdfWrite a Recipe website Project Proposal (HTML,CSS)The Project Prop.pdf
Write a Recipe website Project Proposal (HTML,CSS)The Project Prop.pdf
 
Write in Python please Web Server Python Assignment You will dev.pdf
Write in Python please Web Server Python Assignment You will dev.pdfWrite in Python please Web Server Python Assignment You will dev.pdf
Write in Python please Web Server Python Assignment You will dev.pdf
 

Recently uploaded

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 

Write this in C language. This project will require students to si.pdf

  • 1. Write this in C language. This project will require students to simulate the behaviors of an operating system with a series of assignments. 1. Simulate process allocation to memory blocks based on memory management algorithms First Fit, Best Fit, Next Fit, and Worst Fit. 2. Simulate file management of directories and files stored in a directory. 3. Simulate multi-threaded programming with the POSIX (Portable Operating System Interface) threads (a.k.a. pthreads). C programming language integrated development environment (IDE) 1. Code::Blocks ~ NOT Mac compatible 2. Visual Studio Code 3. Atom 4. https://replit.com/ 5. XCode Assignment Scope: Memory Management 1. First Fit Implementation: a. Input memory blocks with size and processes with size. b. Initialize all memory blocks as free. c. Start by picking each process and check if it can be assigned to current block. d. If size-of-process <= size-of-block if yes then assign and check for next process. e. If not then keep checking the further blocks. 2. Best Fit Implementation: a. Input memory blocks with size and processes with size. b. Initialize all memory blocks as free. c. Start by picking each process and find the minimum block size that can be assigned to current process i.e., find min(blockSize[1], blockSize[2],.....blockSize[n]) > processSize[current], if found then assign it to the current process. d. If not, then leave that process and keep checking the further processes. 3. Worst Fit Implementation: a. Input memory blocks with size and processes with size. b. Initialize all memory blocks as free. c. Start by picking each process and find the maximum block size that can be assigned to current process i.e., find max(blockSize[1], blockSize[2],.....blockSize[n]) >
  • 2. processSize[current], if found then assign it to the current process. d. If not, then leave that process and keep checking the further processes. 4. Next Fit Implementation: a. Input memory blocks with size and processes with size. b. Initialize all memory blocks as free. c. Start by picking each process and check if it can be assigned to the current block, if yes, allocate it the required memory and check for next process but from the block where we left not from starting. d. If the current block size is smaller, keep checking the further blocks. Tasks Activity OSManagement.c 1. Update source code file OSManagement.c preprocessor 2. Add function prototype for functions a. memoryManagement b. displayProcess c. firstFit d. worstFit e. bestFit f. nextFit main 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 a. 1 = call function memoryManagement memoryManagement 4. Write function memoryManagement to do the following a. Return type void b. Empty parameter list c. Call function clearScreen d. 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. Declare a variable, data type integer, to store the
  • 3. number of blocks (i.e. blocks) iv. Declare a variable, data type integer, to store the number of processes (i.e. processes) 3 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 nextFit 5. Write function nextFit to do the following a. Return type void b. Parameter list includes i. One-dimensional array, data type integer, contains the block sizes (i.e. blockSize) ii. Parameter contains the number of blocks, data type integer (i.e. blocks) iii. One-dimensional array, data type integer, contains the process sizes (i.e. processSize) iv. Parameter contains the number of processes, data type integer (i.e. processes) c. Declare a one-dimensional array, data type integer, to store the block id that a process is allocated to (i.e. allocation), size is parameter processes d. Declare a variable, data type integer, to store the block allocation for a process, initialize to 0 (i.e. id) e. Call function memset, passing arguments
  • 4. i. Array allocation ii. -1 (i.e. INVALID) iii. sizeof(allocation) f. Using a looping construct, loop through the number of processes i. Using a looping construct, loop while id is less than the number of blocks 1. If the current block size (i.e. index id) is greater than or equal to the current process size (i.e. index of outer looping variable) a. Update the allocation array to set the element at index of the outer looping variable equal to variable id b. Reduce available memory of the current block size (i.e. index id) by the process 4 size (i.e. index of the outer looping variable) c. break out of the inner loop ii. Update the value of variable id to set the next index in array blockSize by adding 1 to variable id then modulus the total by the number of blocks g. Call function displayProcess passing arguments allocation, processes, and processSize firstFit 6. Write function firstFit to do the following a. Return type void b. Parameter list includes i. One-dimensional array, data type integer, contains the block sizes (i.e. blockSize) ii. Parameter contains the number of blocks, data type integer (i.e. blocks) iii. One-dimensional array, data type integer, contains the process sizes (i.e. processSize) iv. Parameter contains the number of processes, data type integer (i.e. processes)
  • 5. c. Declare a one-dimensional array, data type integer, to store the block id that a process is allocated to (i.e. allocation), size is parameter processes d. Call function memset, passing arguments i. Array allocation ii. -1 (i.e. INVALID) iii. sizeof(allocation) e. Using a looping construct, loop through the number of processes i. Using a looping construct, loop the number of blocks 1. If the current block size (i.e. index of the inner looping variable ) is greater than or equal to the current process size (i.e. index of outer looping variable) a. Update the allocation array to set the element at index of the outer looping variable equal to the inner looping variable b. Reduce available memory of the current block size (i.e. index of the inner looping variable) by the process size (i.e. index of the outer looping variable) c. break out of the inner loop f. Call function displayProcess passing arguments allocation, processes, and processSize 5 bestFit 7. Write function bestFit to do the following a. Return type void b. Parameter list includes i. One-dimensional array, data type integer, contains the block sizes (i.e. blockSize) ii. Parameter contains the number of blocks, data type integer (i.e. blocks) iii. One-dimensional array, data type integer, contains the process sizes (i.e. processSize)
  • 6. iv. Parameter contains the number of processes, data type integer (i.e. processes) c. Declare a one-dimensional array, data type integer, to store the block id that a process is allocated to (i.e. allocation), size is parameter processes d. Call function memset, passing arguments i. Array allocation ii. -1 (i.e. INVALID) iii. sizeof(allocation) e. Using a looping construct, loop through the number of processes i. Declare a variable, data type integer, to store the current best fit value (i.e. bestIdx) initialized to -1 (i.e. INVALID) ii. Using a looping construct, loop the number of blocks 1. If the current block size (i.e. index of the inner looping variable ) is greater than or equal to the current process size (i.e. index of outer looping variable) a. If the value of bestIdx is equal to -1 (i.e. INVALID) i. Set variable bestIdx equal to the current block (i.e. the inner looping variable) b. Else if the value of the block size at index bestIdx is greater than the value of the block size at index of the inner looping variable i. Set variable bestIdx equal to the current block (i.e. the inner looping variable) iii. If the value of variable bestIdx is not equal to -1 (i.e. INVALID) 1. Update the allocation array to set the element at index of the outer looping variable equal to variable bestIdx
  • 7. 6 2. Reduce available memory of the current block size (i.e. index bestIdx) by the process size (i.e. index of the outer looping variable) f. Call function displayProcess passing arguments allocation, processes, and processSize worstFit 8. Write function worstFit to do the following a. Return type void b. Parameter list includes i. One-dimensional array, data type integer, contains the block sizes (i.e. blockSize) ii. Parameter contains the number of blocks, data type integer (i.e. blocks) iii. One-dimensional array, data type integer, contains the process sizes (i.e. processSize) iv. Parameter contains the number of processes, data type integer (i.e. processes) c. Declare a one-dimensional array, data type integer, to store the block id that a process is allocated to (i.e. allocation), size is parameter processes d. Call function memset, passing arguments i. Array allocation ii. -1 (i.e. INVALID) iii. sizeof(allocation) e. Using a looping construct, loop through the number of processes i. Declare a variable, data type integer, to store the current worst fit value (i.e. wstIdx) initialized to -1 (i.e. INVALID) ii. Using a looping construct, loop the number of blocks 1. If the current block size (i.e. index of the inner looping variable ) is greater than or equal to the current process size (i.e. index of outer looping variable) a. If the value of wstIdx is equal to -1 (i.e.
  • 8. INVALID) i. Set variable wstIdx equal to the current block (i.e. the inner looping variable) b. Else if the value of the block size at index wstIdx is less than the value of the block size at index of the inner looping variable i. Set variable wstIdx equal to the current block (i.e. the inner looping variable) 7 iii. If the value of variable wstIdx is not equal to -1 (i.e. INVALID) 1. Update the allocation array to set the element at index of the outer looping variable equal to variable wstIdx 2. Reduce available memory of the current block size (i.e. index wstIdx) by the process size (i.e. index of the outer looping variable) f. Call function displayProcess passing arguments allocation, processes, and processSize displayProcess 9. Write function displayProcess to do the following a. Return type void b. Parameter list includes i. One-dimensional array, data type integer, that stores the block number allocations (i.e. allocation) ii. Parameter that contains the number of processes, data type integer (i.e. processes) iii. One-dimensional array, data type integer, that stores the processes (i.e. processSize) c. Write a looping construct to loop through the processes (i.e. processSize) i. Display to the console the process number (i.e use the looping variable plus 1)
  • 9. ii. Display to the console the process size (i.e. processSize array at the current looping index) iii. Display to the console the memory block assigned based on the following logic 1. If the value stored at the current index of array processSize if -1 (i.e. INVALID), output Not Allocated 2. Else, output the current allocation (i.e. allocation) OSManagement executable Test Case 1 Test Case 1 passes Test Case 2 Test Case 2 passes Test Case 3 Test Case 3 passes Test Case 4 Test Case 4 passes Test Case 5 Test Case 5 passes Test Case 6 Test Case 6 passes Test Case 7 Test Case 7 passes Test Case 8 Test Case 8 passes Source compiles with no errors Source compiles with no warnings Source runs with no errors 8 Source includes comments Perform the following test cases Test Cases Action Expected outcome Test Case 1 Run executable The executable runs The output in the command prompt should be similar to Error! Reference source not found. Test Case 2 User enters an invalid menu option value, value 2, or value 3 The output in the command prompt should
  • 10. be similar to Error! Reference source not found. Test Case 3 User enters menu option value 1; memoryManagement function The output in the command prompt should be similar to Figure 2 memoryManagement function output Test Case 4 User enters menu option value 1; nextFit function The output in the command prompt should be similar to Figure 3 nextFit function output Test Case 5 User enters menu option value 1; firstFit function The output in the command prompt should be similar to Figure 4 firstFit function output Test Case 6 User enters menu option value 1; bestFit function The output in the command prompt should be similar to Figure 5 bestFit function output Test Case 7 User enters menu option value 1; worstFit function The output in the command prompt should be similar to Figure 6 worstFit function output Test Case 8 User enters menu option value 0 End of functionality;