NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Write a note in this area. It's rea#pragma once



class Elevator
{
int Max_Floor, capacity, current_Floor, num_Riders;
public:
Elevator();
Elevator(int Max_Floor,int capacity);
void setMax_Floor(int mf);
void setcapacity(int c);
int getnum_Riders();
int getcurrent_Floor();
void print();
bool Is_Full();
void add_Riders(int num_Persons);
void go_Up_Down(int floors);
bool is_Larger(Elevator e);
};lly easy to share with others. Click here ...

###############################################################
#include<iostream>
#include"Elevator.h"
using namespace std;

Elevator::Elevator()
{
Max_Floor = 0;
current_Floor = 0;
capacity = 0;
num_Riders = 0;

}

Elevator::Elevator(int ca, int m)
{
Max_Floor = m;
capacity = ca;
current_Floor = 0;
num_Riders = 0;
}
void Elevator::setMax_Floor(int mf)
{
Max_Floor = mf;
}

void Elevator::setcapacity(int c)
{
capacity = c;

}

int Elevator::getcurrent_Floor()
{
return current_Floor;
}

int Elevator::getnum_Riders()
{
return num_Riders;
}

void Elevator::print()
{

cout <<"the current floor: " << current_Floor << endl;
cout <<"the num riders: "<< num_Riders << endl;
}

bool Elevator::Is_Full()
{
if (num_Riders == capacity)
return true;
else
return false;
}

void Elevator::add_Riders(int numPersons) {
if (getnum_Riders() + numPersons > capacity)
{
cout << "beeb beeb." << endl;
}
else
num_Riders += numPersons;
}

void Elevator::go_Up_Down(int floor)
{
if (getcurrent_Floor() + floor > Max_Floor|| getcurrent_Floor() + floor < 0)
{
cout << "erorre" << endl;
}
else
current_Floor += floor;
}

bool Elevator::is_Larger(Elevator e)
{
return capacity > e.capacity;
}

################################################################
#include<iostream>
#include"Elevator.h"
using namespace std;


int main()
{
int m, c;
Elevator My_Mall[10];
Elevator E1;
Elevator E2(10, 5);

for (int i = 0; i < 10; i++)
{
cin >> m;
My_Mall[i].setMax_Floor(m);
cin >> c;
My_Mall[i].setcapacity(c);
}
int max = 0;
for (int i = 0; i < 10; i++)
{
if (My_Mall[i].getcurrent_Floor > My_Mall[max].getcurrent_Floor)
max = i;
}

My_Mall[max].print();

int large = 0;
for (int i = 0; i < 10; i++)
{
if (My_Mall[i].is_Larger(My_Mall[large]))
large = i;

}
My_Mall[large].print();

system("pause");



}

int takesArray(int s1[], int s2[],int b,int m)
{
for (int i = 0; i < 4; i++)
{
cin >> s1[i];
cin >> s2[i];
}

for (int i = 0; i < 4; i++)
{
if()
}
}

int testFunction()

int main()
{
int s1[4];
int s2[4];
int a[5];
int arrayCheck = 3;
int acount = 0;
cout << "pleae enter the numbers of the array" << endl;
for (int i = 0; i < 5; i++)
{
cin >> a[i];
}

for (int i = 0; i < 5; i++)
{
if (a[i] == 1)
{

}

}

takesArray(s1, s2, 4, 4);





return 0;
}







     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.