Elevator design

in this code i output for capacity is coming wrong

Hey @nmaurya760 can you please elaborate your issue?

https://drive.google.com/file/d/1fipA-UXsw3XTnovHy5BaDNHS2tEFfBLH/view?usp=drivesdk
This link contains the output of this code
In this code how the capacity is coming out to be 8

Get_max_capacity() function is giving constant return value. Handle your Get_max_capacity() function.

How can it be done please help

Try removing const variable in front of it and see if it works or not.

Not working after removing it

What is it showing after removing const?

It is promoting error multiple errors can you please run this code once on your system

I’ll debug it and let you know. Till then I’ll request you to be patient and try other questions .

Your code consists of lots of garbage value
see this :


Try to initialize it with some initial values and then operate them.

I have initiated them to 0
https://drive.google.com/file/d/1fipA-UXsw3XTnovHy5BaDNHS2tEFfBLH/view?usp=drivesdk

So it’s still showing errors after initialising it with zero?
Try the inout as I have shown in screenshot. If it still gives the same output that means garbage value has not been handled properly.

Share your updated code too.

i debugged your code and now it’s giving output like this


What you were doing wrong was in line 20-25
you were assigning parameters in the function by the private data members of the class. Instead you had to do it’s opposite.
I have edited your code here :smile: