need help

|Hello everyone this is my programme and I wanna ask you... what I have to write in "int main" to get 1.room list 2.every room temperature, humidity and heat index 3.and how to increase or decrease every parameter


#include <iostream>
#include <string>


using namespace std;

struct Klinikos //hospital
{
string Patalpos; //room
float Temperatura; //temperature
float Dregme; //humidity
bool moreTemp;
float KarscioIndeksas; //heatindex

};

int GautiF (int Celsijus); //get Fahrenheit
int GautiC (int Farenheitai); //get Celsius
void GautiTemperatura(int & t);
void KarscioIndeksas(float Temperatura, float Dregme);//funkcija atlikti KI formule
void inputOras(float Temperatura, float Dregme); //inputWeather // funkcija duomenis gauti is vartotojo
bool moreTemp(); //Vartotojas gali paklausti, ar nori keisti temperatura
void TemperaturosTipas(); // F or C temperature type

class Ligonine //clinic
{
private:
int PK;
Klinikos *Patalpos;

public:
Ligonine ()
{
PK = 6; //Patalpu Kiekis //number of rooms
Patalpos = new Klinikos[PK];

Patalpos[0].Patalpos = "Palata"; //ward
Patalpos[1].Patalpos = "Operacine"; //operating-room
Patalpos[2].Patalpos = "Vaistu saugykla"; //medicine storage
Patalpos[3].Patalpos = "Gydytojo kabinetas"; // consulting-room
Patalpos[4].Patalpos = "Koridorius"; //corridor
Patalpos[5].Patalpos = "Reanimacija"; //reanimation room

for (int i=0; i<6; i++)
{
Patalpos[i].Patalpos=6;
}
}

}; // klase ligonine

void inputOras(float Temperatura, float Dregme) {

cout << "Irasykite temperatura: "; // write temperature
cin >> Temperatura;
cout << "Irasykite dregme: "; // write humidity
cin >> Dregme;
while (Dregme <=0)
{
cout << "Dregme turetu buti didesne uz 0.";//humidity should be higher than 0
cin >> Dregme;
}
}

bool moreTemp()
{
string atsakymas; // answer
cout <<"Irasykite kitokia temperatura (T/N)?";//write another temperature
cin >> atsakymas;
while (atsakymas !="T" && atsakymas != "t" && atsakymas !="N" && atsakymas !="n"){
cout <<"Atsakymas T/N:";
cin >> atsakymas;
}
if (atsakymas == "T" || atsakymas == "t"){
return true;
}
return false;
}

void KarscioIndeksas(float Temperatura, float Dregme)
{
const double c1 = -42.379;
const double c2 = 2.04901523;
const double c3 = 10.14333127;
const double c4 = -.22475541;
const double c5 = -0.00683783;
const double c6 = -0.05481717;
const double c7 = 0.00122874;
const double c8 = 0.00085282;
const double c9 = -0.00000199;

double KarscioIndeksas = c1 + (c2 * Temperatura)+(c3 * Dregme) + (c4 * Temperatura*Dregme) +(c5 * (Temperatura*Temperatura)) +(c6 * (Dregme * Dregme)) + (c7 * (Temperatura * Temperatura) * Dregme) + (c8 * Temperatura * (Dregme * Dregme)) + (c9 * (Temperatura * Temperatura) * (Dregme * Dregme));


}

int main ()
{
int Temperatura = 0;
double Dregme = 0;
double KarscioIndeksas;
double Celsijus;
double Farenheitai;
GautiTemperatura(Temperatura); // get temperature

do
{
cout <<"Iveskite Celsijaus temperatura: ";
cin >> Celsijus;
Farenheitai = Celsijus * 9.0 / 5.0 + 32.0;
cout << Celsijus << " Laipsniai C yra " << Farenheitai << " laipsniai F." << endl << endl;

cout << "Iveskite Farenheito temperatura: ";
cin >> Farenheitai;
Celsijus = (Farenheitai - 32.0) * 5.0 / 9.0;
cout << Farenheitai << " Laipsniai F yra " << Celsijus << " laipsniai C." << endl;

return 0;
}

}
closed account (SECMoG1T)
Do you want something similar to this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
///this function prints the details of all  rooms stored in an array
void print_list (klinokos array [], int size)
{ 
    for (int i=0; i <size; i++)
      {
         cout <<"\n\nRoom "<<i+1 <<endl; 
         cout <<" Room name               :" <<array [i].Patalpos <<endl;
         cout <<" Room temperatute   :" <<array [i].Temperatura <<endl;
         cout <<" Room humidity         :" <<array [i].Dregem <<endl; 
         cout <<" Room heatindex       : " <<array [i].karscioindeksas <<endl;
       }
}

int main ()
{

   klinikos my_rooms[10];
  ///add their names and other parameters

  print_list (my_rooms, 10);

  ///other stuff here
}

Last edited on
Looks like you solved my problem... I will try to finish... thanks Bro :)
closed account (SECMoG1T)
Please Note;)
Always use code tags whenever you want to post some code, that way your code will be easy to read
[Syntax highlighting, line numbering] and alot of people here will be ready to help -

I mean like this

[code]
write your code between the tags
[/code]
I'm sorry I'm a beginner :D

Actually everything works what u wrote to me... but I don't know what and how to write here ---->

1
2
3
4
5
6
7
8
9
10
  int main ()
   {

      Klinikos my_Patalpos[6];
      
      print_Sarasas (my_Patalpos, 6);

    
   }



P.S. Do you have skype ??? I will show u what I've got
Last edited on
closed account (SECMoG1T)
It's okay hehe, just send me a PM on my account here i'll have a look at it ;)
Topic archived. No new replies allowed.