SlideShare a Scribd company logo
1 of 2
Download to read offline
FAST university has hired you to make an operating system for their lifts. Below are specifications
of the lifts OS. The lift will be placed in a building with 6 floors including a basement. From
basement to top floors are labeled as -1,0,1,2,3,4 respectively. In the morning, the lift goes into
operation from the basement. The lift can go up and down. If maintenance is required, the lift can
be halted. If the lift is halted, the lift not usable during that period. Once unhalted, the lift can be
used again. All this lift data is stored in a doubly linked list. In case university decides to make a
new floor, they can enter a new floor as floor 5. Moreover, due to some operational constraints,
they might decide to choose that the lift should not stop on some floor for better load management.
For example, the university can decide the lift will only operate on basement, 1st floor and 3rd floor
then the lift will only operate on these floors. University can decide to change it and make it
operational for all floors as well. With the help of above information, make a lift operating system
which will have following functions. int lift_operating_system(int requested_floor, lift_floors
*current, lift_floors *head, lift_floors *tail, char lift_status) // this function valises the lift request and
then performs the lift up or lift down function. Once the function is performed, the lift operating
system returns the new current floor after lift goes up or down. int liftup(lift_floors *current,
lift_floors *head, lift_floors *tail,int requested_floor ) // a recursive function used to move the lift in
upwards direction int liftdown(lift_floors *current, lift_floors *head, lift_floors *tail,int requested_floor
) // a recursive function used to move the lift in downwards direction char halt_lift(char status)
//halts the lift, no up and down operation can be performed. Stored H for halting char
un_halt_lift(char status) //Unhalts the lift. Store W which represents that the lift is working. void
add_floor(lift_floors *new_floor, lift_floors *head, lift_floors *tail) //add a lift floor; void
skip_floor(lift_floors *head, lift_floors *tail, int floorNo) //add logic to make lift skip a certain floor
void make_floor_operational(lift_floors *head, lift_floors *tail, int floorNo) //add logic to make lift
operational on a certain floor Main function: The main maintains the following is in an endless loop
and asks the user to select on of the following operations. (1) Go to a floor. 2) Halt the lift. 3)
Unhalt the lift. 4) Add floor. 5) Skip Floor 6) Make floor operational. 7) Exit
PLS DO THE FOLLOWING USING LINKED LIST IN C++ ONLY AND HERE WE ARE
PROVIDED SOME STARTER CODE FOLLOW IT PLS
* FAST university has hired you to make an operating system for their lifts. Below are
specifications of the lifts OS. The lift will be place in a building with 6 floors including a basement.
From basement to top floors are labeled as -1,0,1,2,3,4 respectively. In the morning, the lift goes
operation from the basement. The lift can go up and down. If maintained is required, the lift can be
halted. If the lift is halted, the lift not usable during that period. Once unhalted, the lift can be used
again. With the help of above information, make a lift operating system */ #include<iostream>
using namespace std; class lift_floors { public: int floor; char floor_status; //A for active N for not
active lift_floors* next; lift_floors* prev; lift_floors(int data) { this->floor = data; this->next = NULL;
this->prev = NULL; this->floor_status = 'A'; } }; int lift_operating_system(int requested_floor,
lift_floors *&current, lift_floors *&head, lift_floors *&tail, char lift_status) { //all lift related logic will be
written in this bloack along with validation. In this funcation, decide //if the lift goes up or down } int
liftup(lift_floors *&current, lift_floors *&head, lift_floors *&tail,int requested_floor ) { //recurrsive
funcation to take lift up } int liftdown(lift_floors *&current, lift_floors *&head, lift_floors *&tail,int
requested_floor ) { //recurrsive funcation to bring the lift down } char halt_lift(char status) { //halts
the lift, no up and down operation can be performed. Stored H for halting } char un_halt_lift(char
status) { //Unhatls the lift. Store W which represents that the lift is working } void
add_floor(lift_floors *&new_floor, lift_floors *&head, lift_floors *&tail) { //add a lift floor; } void
skip_floor(lift_floors *&head, lift_floors *&tail, int floorNo) { //add logic to make lift skip a certian
floor } void make_floor_operational(lift_floors *&head, lift_floors *&tail, int floorNo) { //add logic to
make lift operational on a certain floor } main() { lift_floors *head; lift_floors *tail; lift_floors *current;
int total_floors = 6; // total number of floors int current_floor = -1; // starts with basement int
requested_service; //choice of user int requested_floor; //floor the lift goes on char status= 'W'; //W
for working , H for halted //initialize everything and poplate the link list based on above data. //use
add floor to add all the floors in the list while(1) { cout<<"Please select a funcation of your choice";
cout<< endl << "1. Go to a specific floor"; cout<< endl << "2. Halt Lift"; cout<< endl << "3. Unhalt
Lift"; //.. add other options cin >> requested_service; switch(requested_service) case 1: { cout <<
endl << "Enter Floor of choice "; cin >> requested_floor; // lift_operating _system();//add
arguments //your code here } //case 2: // { // // } // } }
PLS DO THE FOLLOWING USING LINKED LIST IN C++ ONLY AND HERE WE ARE
PROVIDED SOME STARTER CODE FOLLOW IT PLS
FAST university has hired you to make an operating system for their lifts. Below are specifications
of the lifts OS. The lift will be placed in a building with 6 floors including a basement. From
basement to top floors are labeled as 1,0,1,2,3,4 respectively. In the morning, the lift goes into
operation from the basement. The lift can go up and down. If maintenance is required, the lift can
be halted. If the lift is halted, the lift not usable during that period. Once unhalted, the lift can be
used again. All this lift data is stored in a doubly linked list. In case university decides to make a
new floor, they can enter a new floor as floor 5. Moreover, due to some operational constraints,
they might decide to choose that the lift should not stop on some floor for better load management.
For example, the university can decide the lift will only operate on basement, 1st floor and 3rd floor
then the lift will only operate on these floors. University can decide to change it and make it
operational for all floors as well. With the help of above information, make a lift operating system
which will have following functions. int lift_operating_system(int requested_floor, lift_floors
*current, lift_floors *head, lift_floors *tail, char lift_status) // this function valises the lift request and
then performs the lift up or lift down function. Once the function is performed, the lift operating
system returns the new current floor after lift goes up or down. int liftup(lift_floors *current,
lift_floors *head, lift_floors *tail,int requested_floor) // a recursive function used to move the lift in
upwards direction int liftdown(lift_floors *current, lift_floors *head, lift_floors *tail,int
requested_floor)Main function: The main maintains the following is in an endless loop and asks
the user to select on of the following operations. (1) Go to a floor. 2) Halt the lift. 3) Unhalt the lift.
4) Add floor. 5) Skip Floor 6) Make floor operational. 7) Exit

More Related Content

More from acupressuresujok

FARO Technologies whose products incluste portable 30 measu.pdf
FARO Technologies whose products incluste portable 30 measu.pdfFARO Technologies whose products incluste portable 30 measu.pdf
FARO Technologies whose products incluste portable 30 measu.pdfacupressuresujok
 
FAOFunded Aquaponics Project Launched In Barbados Barbados .pdf
FAOFunded Aquaponics Project Launched In Barbados Barbados .pdfFAOFunded Aquaponics Project Launched In Barbados Barbados .pdf
FAOFunded Aquaponics Project Launched In Barbados Barbados .pdfacupressuresujok
 
Farkl sektrlerdeki 4 farkl hizmet iletmesi iin Web siteler.pdf
Farkl sektrlerdeki 4 farkl hizmet iletmesi iin Web siteler.pdfFarkl sektrlerdeki 4 farkl hizmet iletmesi iin Web siteler.pdf
Farkl sektrlerdeki 4 farkl hizmet iletmesi iin Web siteler.pdfacupressuresujok
 
Farelerde siyah krk B beyaza b baskndr farkl bir baskn.pdf
Farelerde siyah krk B beyaza b baskndr farkl bir baskn.pdfFarelerde siyah krk B beyaza b baskndr farkl bir baskn.pdf
Farelerde siyah krk B beyaza b baskndr farkl bir baskn.pdfacupressuresujok
 
Famoso por sus impactantes anuncios Benetton comenz en 195.pdf
Famoso por sus impactantes anuncios Benetton comenz en 195.pdfFamoso por sus impactantes anuncios Benetton comenz en 195.pdf
Famoso por sus impactantes anuncios Benetton comenz en 195.pdfacupressuresujok
 
FACT SUMMARY Waddell and Rustin entered partners When the p.pdf
FACT SUMMARY Waddell and Rustin entered partners When the p.pdfFACT SUMMARY Waddell and Rustin entered partners When the p.pdf
FACT SUMMARY Waddell and Rustin entered partners When the p.pdfacupressuresujok
 
Falcon Corporation compr un activo depreciable por 840 000.pdf
Falcon Corporation compr un activo depreciable por 840 000.pdfFalcon Corporation compr un activo depreciable por 840 000.pdf
Falcon Corporation compr un activo depreciable por 840 000.pdfacupressuresujok
 
Fadeley Inc uses activhbased costing to account for its c.pdf
Fadeley Inc uses activhbased costing to account for its c.pdfFadeley Inc uses activhbased costing to account for its c.pdf
Fadeley Inc uses activhbased costing to account for its c.pdfacupressuresujok
 
FA es un 80 aos hombre que se presenta al Hospital de la A.pdf
FA es un 80 aos hombre que se presenta al Hospital de la A.pdfFA es un 80 aos hombre que se presenta al Hospital de la A.pdf
FA es un 80 aos hombre que se presenta al Hospital de la A.pdfacupressuresujok
 
FA illustrates D is any digit L is a lowercase letter othe.pdf
FA illustrates D is any digit L is a lowercase letter othe.pdfFA illustrates D is any digit L is a lowercase letter othe.pdf
FA illustrates D is any digit L is a lowercase letter othe.pdfacupressuresujok
 
Factors Determining Comparative Advantage Five years ago Sc.pdf
Factors Determining Comparative Advantage Five years ago Sc.pdfFactors Determining Comparative Advantage Five years ago Sc.pdf
Factors Determining Comparative Advantage Five years ago Sc.pdfacupressuresujok
 
Fact The following information from OBD is availabie Roquir.pdf
Fact The following information from OBD is availabie Roquir.pdfFact The following information from OBD is availabie Roquir.pdf
Fact The following information from OBD is availabie Roquir.pdfacupressuresujok
 
f the probability distribution of a random variable X has me.pdf
f the probability distribution of a random variable X has me.pdff the probability distribution of a random variable X has me.pdf
f the probability distribution of a random variable X has me.pdfacupressuresujok
 
f One of the secure solutions to store passwords in a data.pdf
f One of the secure solutions to store passwords in a data.pdff One of the secure solutions to store passwords in a data.pdf
f One of the secure solutions to store passwords in a data.pdfacupressuresujok
 
F Ditributios n005 in the Riahe Tnill Question 1 3 pt de.pdf
F Ditributios n005 in the Riahe Tnill Question 1 3 pt de.pdfF Ditributios n005 in the Riahe Tnill Question 1 3 pt de.pdf
F Ditributios n005 in the Riahe Tnill Question 1 3 pt de.pdfacupressuresujok
 
EXTRA CREDIT Write a function to be included in a sorted li.pdf
EXTRA CREDIT Write a function to be included in a sorted li.pdfEXTRA CREDIT Write a function to be included in a sorted li.pdf
EXTRA CREDIT Write a function to be included in a sorted li.pdfacupressuresujok
 
Extrachromosomal pieces of DNA which promote transfer of gen.pdf
Extrachromosomal pieces of DNA which promote transfer of gen.pdfExtrachromosomal pieces of DNA which promote transfer of gen.pdf
Extrachromosomal pieces of DNA which promote transfer of gen.pdfacupressuresujok
 
Eyeless D melanogasterda 4 kromozom zerindeki bir gen i.pdf
Eyeless D melanogasterda 4 kromozom zerindeki bir gen i.pdfEyeless D melanogasterda 4 kromozom zerindeki bir gen i.pdf
Eyeless D melanogasterda 4 kromozom zerindeki bir gen i.pdfacupressuresujok
 
External validity is high when you can apply your research t.pdf
External validity is high when you can apply your research t.pdfExternal validity is high when you can apply your research t.pdf
External validity is high when you can apply your research t.pdfacupressuresujok
 
Express the confidence interval from 28 to 402 in the for.pdf
Express the confidence interval from 28 to 402 in the for.pdfExpress the confidence interval from 28 to 402 in the for.pdf
Express the confidence interval from 28 to 402 in the for.pdfacupressuresujok
 

More from acupressuresujok (20)

FARO Technologies whose products incluste portable 30 measu.pdf
FARO Technologies whose products incluste portable 30 measu.pdfFARO Technologies whose products incluste portable 30 measu.pdf
FARO Technologies whose products incluste portable 30 measu.pdf
 
FAOFunded Aquaponics Project Launched In Barbados Barbados .pdf
FAOFunded Aquaponics Project Launched In Barbados Barbados .pdfFAOFunded Aquaponics Project Launched In Barbados Barbados .pdf
FAOFunded Aquaponics Project Launched In Barbados Barbados .pdf
 
Farkl sektrlerdeki 4 farkl hizmet iletmesi iin Web siteler.pdf
Farkl sektrlerdeki 4 farkl hizmet iletmesi iin Web siteler.pdfFarkl sektrlerdeki 4 farkl hizmet iletmesi iin Web siteler.pdf
Farkl sektrlerdeki 4 farkl hizmet iletmesi iin Web siteler.pdf
 
Farelerde siyah krk B beyaza b baskndr farkl bir baskn.pdf
Farelerde siyah krk B beyaza b baskndr farkl bir baskn.pdfFarelerde siyah krk B beyaza b baskndr farkl bir baskn.pdf
Farelerde siyah krk B beyaza b baskndr farkl bir baskn.pdf
 
Famoso por sus impactantes anuncios Benetton comenz en 195.pdf
Famoso por sus impactantes anuncios Benetton comenz en 195.pdfFamoso por sus impactantes anuncios Benetton comenz en 195.pdf
Famoso por sus impactantes anuncios Benetton comenz en 195.pdf
 
FACT SUMMARY Waddell and Rustin entered partners When the p.pdf
FACT SUMMARY Waddell and Rustin entered partners When the p.pdfFACT SUMMARY Waddell and Rustin entered partners When the p.pdf
FACT SUMMARY Waddell and Rustin entered partners When the p.pdf
 
Falcon Corporation compr un activo depreciable por 840 000.pdf
Falcon Corporation compr un activo depreciable por 840 000.pdfFalcon Corporation compr un activo depreciable por 840 000.pdf
Falcon Corporation compr un activo depreciable por 840 000.pdf
 
Fadeley Inc uses activhbased costing to account for its c.pdf
Fadeley Inc uses activhbased costing to account for its c.pdfFadeley Inc uses activhbased costing to account for its c.pdf
Fadeley Inc uses activhbased costing to account for its c.pdf
 
FA es un 80 aos hombre que se presenta al Hospital de la A.pdf
FA es un 80 aos hombre que se presenta al Hospital de la A.pdfFA es un 80 aos hombre que se presenta al Hospital de la A.pdf
FA es un 80 aos hombre que se presenta al Hospital de la A.pdf
 
FA illustrates D is any digit L is a lowercase letter othe.pdf
FA illustrates D is any digit L is a lowercase letter othe.pdfFA illustrates D is any digit L is a lowercase letter othe.pdf
FA illustrates D is any digit L is a lowercase letter othe.pdf
 
Factors Determining Comparative Advantage Five years ago Sc.pdf
Factors Determining Comparative Advantage Five years ago Sc.pdfFactors Determining Comparative Advantage Five years ago Sc.pdf
Factors Determining Comparative Advantage Five years ago Sc.pdf
 
Fact The following information from OBD is availabie Roquir.pdf
Fact The following information from OBD is availabie Roquir.pdfFact The following information from OBD is availabie Roquir.pdf
Fact The following information from OBD is availabie Roquir.pdf
 
f the probability distribution of a random variable X has me.pdf
f the probability distribution of a random variable X has me.pdff the probability distribution of a random variable X has me.pdf
f the probability distribution of a random variable X has me.pdf
 
f One of the secure solutions to store passwords in a data.pdf
f One of the secure solutions to store passwords in a data.pdff One of the secure solutions to store passwords in a data.pdf
f One of the secure solutions to store passwords in a data.pdf
 
F Ditributios n005 in the Riahe Tnill Question 1 3 pt de.pdf
F Ditributios n005 in the Riahe Tnill Question 1 3 pt de.pdfF Ditributios n005 in the Riahe Tnill Question 1 3 pt de.pdf
F Ditributios n005 in the Riahe Tnill Question 1 3 pt de.pdf
 
EXTRA CREDIT Write a function to be included in a sorted li.pdf
EXTRA CREDIT Write a function to be included in a sorted li.pdfEXTRA CREDIT Write a function to be included in a sorted li.pdf
EXTRA CREDIT Write a function to be included in a sorted li.pdf
 
Extrachromosomal pieces of DNA which promote transfer of gen.pdf
Extrachromosomal pieces of DNA which promote transfer of gen.pdfExtrachromosomal pieces of DNA which promote transfer of gen.pdf
Extrachromosomal pieces of DNA which promote transfer of gen.pdf
 
Eyeless D melanogasterda 4 kromozom zerindeki bir gen i.pdf
Eyeless D melanogasterda 4 kromozom zerindeki bir gen i.pdfEyeless D melanogasterda 4 kromozom zerindeki bir gen i.pdf
Eyeless D melanogasterda 4 kromozom zerindeki bir gen i.pdf
 
External validity is high when you can apply your research t.pdf
External validity is high when you can apply your research t.pdfExternal validity is high when you can apply your research t.pdf
External validity is high when you can apply your research t.pdf
 
Express the confidence interval from 28 to 402 in the for.pdf
Express the confidence interval from 28 to 402 in the for.pdfExpress the confidence interval from 28 to 402 in the for.pdf
Express the confidence interval from 28 to 402 in the for.pdf
 

Recently uploaded

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

FAST university has hired you to make an operating system fo.pdf

  • 1. FAST university has hired you to make an operating system for their lifts. Below are specifications of the lifts OS. The lift will be placed in a building with 6 floors including a basement. From basement to top floors are labeled as -1,0,1,2,3,4 respectively. In the morning, the lift goes into operation from the basement. The lift can go up and down. If maintenance is required, the lift can be halted. If the lift is halted, the lift not usable during that period. Once unhalted, the lift can be used again. All this lift data is stored in a doubly linked list. In case university decides to make a new floor, they can enter a new floor as floor 5. Moreover, due to some operational constraints, they might decide to choose that the lift should not stop on some floor for better load management. For example, the university can decide the lift will only operate on basement, 1st floor and 3rd floor then the lift will only operate on these floors. University can decide to change it and make it operational for all floors as well. With the help of above information, make a lift operating system which will have following functions. int lift_operating_system(int requested_floor, lift_floors *current, lift_floors *head, lift_floors *tail, char lift_status) // this function valises the lift request and then performs the lift up or lift down function. Once the function is performed, the lift operating system returns the new current floor after lift goes up or down. int liftup(lift_floors *current, lift_floors *head, lift_floors *tail,int requested_floor ) // a recursive function used to move the lift in upwards direction int liftdown(lift_floors *current, lift_floors *head, lift_floors *tail,int requested_floor ) // a recursive function used to move the lift in downwards direction char halt_lift(char status) //halts the lift, no up and down operation can be performed. Stored H for halting char un_halt_lift(char status) //Unhalts the lift. Store W which represents that the lift is working. void add_floor(lift_floors *new_floor, lift_floors *head, lift_floors *tail) //add a lift floor; void skip_floor(lift_floors *head, lift_floors *tail, int floorNo) //add logic to make lift skip a certain floor void make_floor_operational(lift_floors *head, lift_floors *tail, int floorNo) //add logic to make lift operational on a certain floor Main function: The main maintains the following is in an endless loop and asks the user to select on of the following operations. (1) Go to a floor. 2) Halt the lift. 3) Unhalt the lift. 4) Add floor. 5) Skip Floor 6) Make floor operational. 7) Exit PLS DO THE FOLLOWING USING LINKED LIST IN C++ ONLY AND HERE WE ARE PROVIDED SOME STARTER CODE FOLLOW IT PLS * FAST university has hired you to make an operating system for their lifts. Below are specifications of the lifts OS. The lift will be place in a building with 6 floors including a basement. From basement to top floors are labeled as -1,0,1,2,3,4 respectively. In the morning, the lift goes operation from the basement. The lift can go up and down. If maintained is required, the lift can be halted. If the lift is halted, the lift not usable during that period. Once unhalted, the lift can be used again. With the help of above information, make a lift operating system */ #include<iostream> using namespace std; class lift_floors { public: int floor; char floor_status; //A for active N for not active lift_floors* next; lift_floors* prev; lift_floors(int data) { this->floor = data; this->next = NULL; this->prev = NULL; this->floor_status = 'A'; } }; int lift_operating_system(int requested_floor, lift_floors *&current, lift_floors *&head, lift_floors *&tail, char lift_status) { //all lift related logic will be written in this bloack along with validation. In this funcation, decide //if the lift goes up or down } int liftup(lift_floors *&current, lift_floors *&head, lift_floors *&tail,int requested_floor ) { //recurrsive funcation to take lift up } int liftdown(lift_floors *&current, lift_floors *&head, lift_floors *&tail,int requested_floor ) { //recurrsive funcation to bring the lift down } char halt_lift(char status) { //halts
  • 2. the lift, no up and down operation can be performed. Stored H for halting } char un_halt_lift(char status) { //Unhatls the lift. Store W which represents that the lift is working } void add_floor(lift_floors *&new_floor, lift_floors *&head, lift_floors *&tail) { //add a lift floor; } void skip_floor(lift_floors *&head, lift_floors *&tail, int floorNo) { //add logic to make lift skip a certian floor } void make_floor_operational(lift_floors *&head, lift_floors *&tail, int floorNo) { //add logic to make lift operational on a certain floor } main() { lift_floors *head; lift_floors *tail; lift_floors *current; int total_floors = 6; // total number of floors int current_floor = -1; // starts with basement int requested_service; //choice of user int requested_floor; //floor the lift goes on char status= 'W'; //W for working , H for halted //initialize everything and poplate the link list based on above data. //use add floor to add all the floors in the list while(1) { cout<<"Please select a funcation of your choice"; cout<< endl << "1. Go to a specific floor"; cout<< endl << "2. Halt Lift"; cout<< endl << "3. Unhalt Lift"; //.. add other options cin >> requested_service; switch(requested_service) case 1: { cout << endl << "Enter Floor of choice "; cin >> requested_floor; // lift_operating _system();//add arguments //your code here } //case 2: // { // // } // } } PLS DO THE FOLLOWING USING LINKED LIST IN C++ ONLY AND HERE WE ARE PROVIDED SOME STARTER CODE FOLLOW IT PLS FAST university has hired you to make an operating system for their lifts. Below are specifications of the lifts OS. The lift will be placed in a building with 6 floors including a basement. From basement to top floors are labeled as 1,0,1,2,3,4 respectively. In the morning, the lift goes into operation from the basement. The lift can go up and down. If maintenance is required, the lift can be halted. If the lift is halted, the lift not usable during that period. Once unhalted, the lift can be used again. All this lift data is stored in a doubly linked list. In case university decides to make a new floor, they can enter a new floor as floor 5. Moreover, due to some operational constraints, they might decide to choose that the lift should not stop on some floor for better load management. For example, the university can decide the lift will only operate on basement, 1st floor and 3rd floor then the lift will only operate on these floors. University can decide to change it and make it operational for all floors as well. With the help of above information, make a lift operating system which will have following functions. int lift_operating_system(int requested_floor, lift_floors *current, lift_floors *head, lift_floors *tail, char lift_status) // this function valises the lift request and then performs the lift up or lift down function. Once the function is performed, the lift operating system returns the new current floor after lift goes up or down. int liftup(lift_floors *current, lift_floors *head, lift_floors *tail,int requested_floor) // a recursive function used to move the lift in upwards direction int liftdown(lift_floors *current, lift_floors *head, lift_floors *tail,int requested_floor)Main function: The main maintains the following is in an endless loop and asks the user to select on of the following operations. (1) Go to a floor. 2) Halt the lift. 3) Unhalt the lift. 4) Add floor. 5) Skip Floor 6) Make floor operational. 7) Exit