# data[].attributes.attachment_link.readable_text
#include<iostream>
using namespace std;
int main()

 {
    const int SIZE = 20;
   
    char A, B, C, D;
   
    char correctAnswers[SIZE] = {'B', 'D', 'A', 'A', 'C', 'A', 'B', 'A', 'C', 'D', 'B', 'C', 'D', 'A', 'D', 'C', 'C', 'B', 'D', 'A'};
   
    char userAnswers[SIZE];
    
    char Correctness[SIZE];
    int sum = 0;
    int index, count; 
    int finalcount;

    cout << "Driver's License Exam Grader" << endl;
  
    for (index = 1; index < 21; index++)
    {
        cout << "Enter your answer for question " << index << endl;
        cin >> userAnswers[index];

       
        if (userAnswers[index] != correctAnswers[index])
        {
          
            Correctness[index] = 'W';
        }
        else
        {
          
            Correctness[index] = 'R';
        }
    }
    
   for (index = 1; index < 21; index++)
    {
      
        if (Correctness[index] == 'W')
        {
            cout << "Answer " << index << " is incorrect." << endl;
        }
        else
        {
            sum += 1;
        }
    }

    finalcount = 20 - sum;
    
    cout << "Results (minimum 15 correct to pass):" << endl;
    cout << "You got " << sum << " correct. " << endl;
    cout << "You missed " << (20 - sum) << "." << endl;
    if (sum >= 15)
    {
        cout << "You've passed!" << endl;
    }
    else
    {
        cout << "You've failed." << endl;
    }
	
return 0;
}

# data[].attributes.attachment_link.readable_text
#include<iostream>
using namespace std;
int main()

 {
    const int SIZE = 20;
   
    char A, B, C, D;
   
    char correctAnswers[SIZE] = {'B', 'D', 'A', 'A', 'C', 'A', 'B', 'A', 'C', 'D', 'B', 'C', 'D', 'A', 'D', 'C', 'C', 'B', 'D', 'A'};
   
    char userAnswers[SIZE];
    
    char Correctness[SIZE];
    int sum = 0;
    int index, count; 
    int finalcount;

    cout << "Driver's License Exam Grader" << endl;
  
    for (index = 1; index < 21; index++)
    {
        cout << "Enter your answer for question " << index << endl;
        cin >> userAnswers[index];

       
        if (userAnswers[index] != correctAnswers[index])
        {
          
            Correctness[index] = 'W';
        }
        else
        {
          
            Correctness[index] = 'R';
        }
    }
    
   for (index = 1; index < 21; index++)
    {
      
        if (Correctness[index] == 'W')
        {
            cout << "Answer " << index << " is incorrect." << endl;
        }
        else
        {
            sum += 1;
        }
    }

    finalcount = 20 - sum;
    
    cout << "Results (minimum 15 correct to pass):" << endl;
    cout << "You got " << sum << " correct. " << endl;
    cout << "You missed " << (20 - sum) << "." << endl;
    if (sum >= 15)
    {
        cout << "You've passed!" << endl;
    }
    else
    {
        cout << "You've failed." << endl;
    }
	
return 0;
}

# data[].attributes.body
B011410137

# data[].attributes.attachment_link.readable_text
include<iostream>
using namespace std;


int main ()

int main ()
{



	double numFloors,numRooms,occupiedRooms,perRooms;

	double totalRooms;
	double totalOccupRooms;


		cout<<"Enter number of floors:";
		cin>>numFloors;

	if (numFloors <1)
	{
		cout<<"RE-Enter number of floors:";
		cin>>numFloors;
	}

	for(int i=0;i<numFloors;i++)
	{

		if(numFloors>=13)
		break;

		cout<<"Enter number of rooms:";
		cin>>numRooms;

	if(noRooms<10)
	{
		cout<<"ReEnter number of rooms:";
		cin>>numRooms ;
	}


	totalRooms = 0.0;
	totalRooms = totalRooms + numRooms;
	cout<<"Enter number of occupied rooms:";
	cin>>occupiedRooms;
	totalOccupRooms = 0.0;
	totalOccupRooms=totalOccupRooms+occupiedRooms;



	cout<<"Total number of rooms in hotel:"<<totalRooms<<endl;
	cout<<"Occupied Rooms: "<<totalOccupRooms<<endl;
	cout<<"Un-occupied Rooms: "<<totalRooms-totalOccupRooms
	<<endl;


	perRooms=(totalOccupRooms/totalRooms) *100;
	cout<<"Percentage of occupied:"<<perRooms<<endl;

}


return 0;
}

# data[].attributes.body
number.txt

# data[].attributes.attachment_link.readable_text
include<iostream>
using namespace std;


int main ()

int main ()
{



	double numFloors,numRooms,occupiedRooms,perRooms;

	double totalRooms;
	double totalOccupRooms;


		cout<<"Enter number of floors:";
		cin>>numFloors;

	if (numFloors <1)
	{
		cout<<"RE-Enter number of floors:";
		cin>>numFloors;
	}

	for(int i=0;i<numFloors;i++)
	{

		if(numFloors>=13)
		break;

		cout<<"Enter number of rooms:";
		cin>>numRooms;

	if(noRooms<10)
	{
		cout<<"ReEnter number of rooms:";
		cin>>numRooms ;
	}


	totalRooms = 0.0;
	totalRooms = totalRooms + numRooms;
	cout<<"Enter number of occupied rooms:";
	cin>>occupiedRooms;
	totalOccupRooms = 0.0;
	totalOccupRooms=totalOccupRooms+occupiedRooms;



	cout<<"Total number of rooms in hotel:"<<totalRooms<<endl;
	cout<<"Occupied Rooms: "<<totalOccupRooms<<endl;
	cout<<"Un-occupied Rooms: "<<totalRooms-totalOccupRooms
	<<endl;


	perRooms=(totalOccupRooms/totalRooms) *100;
	cout<<"Percentage of occupied:"<<perRooms<<endl;

}


return 0;
}

# data[].attributes.attachment_link.readable_text
include<iostream>
using namespace std;


int main ()

int main ()
{



	double numFloors,numRooms,occupiedRooms,perRooms;

	double totalRooms;
	double totalOccupRooms;


		cout<<"Enter number of floors:";
		cin>>numFloors;

	if (numFloors <1)
	{
		cout<<"RE-Enter number of floors:";
		cin>>numFloors;
	}

	for(int i=0;i<numFloors;i++)
	{

		if(numFloors>=13)
		break;

		cout<<"Enter number of rooms:";
		cin>>numRooms;

	if(noRooms<10)
	{
		cout<<"ReEnter number of rooms:";
		cin>>numRooms ;
	}


	totalRooms = 0.0;
	totalRooms = totalRooms + numRooms;
	cout<<"Enter number of occupied rooms:";
	cin>>occupiedRooms;
	totalOccupRooms = 0.0;
	totalOccupRooms=totalOccupRooms+occupiedRooms;



	cout<<"Total number of rooms in hotel:"<<totalRooms<<endl;
	cout<<"Occupied Rooms: "<<totalOccupRooms<<endl;
	cout<<"Un-occupied Rooms: "<<totalRooms-totalOccupRooms
	<<endl;


	perRooms=(totalOccupRooms/totalRooms) *100;
	cout<<"Percentage of occupied:"<<perRooms<<endl;

}


return 0;
}

# data[].attributes.body
MOhd ezwan Bin elias B011410265

# data[].attributes.body
B011410094

//Name: Lee Chuen How //B011410094 #include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { int numfloors=0, rooms=0, occupancy=0, TRooms=0, TOccupied=0, TUnoccupied=0; double occupRate; cout<< "How many floors are there in the hotel? \n"; cin >> numfloors; while (numfloors < 1) { cout << "ERROR: You cannot enter 0 or less for the number of floors!\n"; cout << "PLEASE TRY AGAIN.\n"; cin >> numfloors; } for (int floor = 1; floor <= numfloors; floor++) { cout << "How many rooms are in the #" << floor << " floor?\n"; if (floor == 13) { //if count is equal to 13, give the following message, then skip to top cout <<"We will be skipping floor #13, as is common in most hotels.\n"<< endl; continue; } cin >> rooms; TRooms += rooms; cout << "How many rooms to be occupied??\n"; cin >> occupancy; TOccupied += occupancy; TUnoccupied = TRooms-TOccupied; occupRate= static_cast<double>(TOccupied) / TRooms; } cout << "\n\nThe hotel has " << TRooms << " rooms \n"; cout << TOccupied << " rooms are occupied.\n"; cout << TUnoccupied << " rooms are unoccupied.\n"; cout << fixed << showpoint << setprecision(1); cout << occupRate*100 << "% of the rooms are occupied.\n\n"; return 0; }

# data[].attributes.body
B011410094

//Name: Lee Chuen How //B011410094 #include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { int numfloors=0, rooms=0, occupancy=0, TRooms=0, TOccupied=0, TUnoccupied=0; double occupRate; cout<< "How many floors are there in the hotel? \n"; cin >> numfloors; while (numfloors < 1) { cout << "ERROR: You cannot enter 0 or less for the number of floors!\n"; cout << "PLEASE TRY AGAIN.\n"; cin >> numfloors; } for (int floor = 1; floor <= numfloors; floor++) { cout << "How many rooms are in the #" << floor << " floor?\n"; if (floor == 13) { //if count is equal to 13, give the following message, then skip to top cout <<"We will be skipping floor #13, as is common in most hotels.\n"<< endl; continue; } cin >> rooms; TRooms += rooms; cout << "How many rooms to be occupied??\n"; cin >> occupancy; TOccupied += occupancy; TUnoccupied = TRooms-TOccupied; occupRate= static_cast<double>(TOccupied) / TRooms; } cout << "\n\nThe hotel has " << TRooms << " rooms \n"; cout << TOccupied << " rooms are occupied.\n"; cout << TUnoccupied << " rooms are unoccupied.\n"; cout << fixed << showpoint << setprecision(1); cout << occupRate*100 << "% of the rooms are occupied.\n\n"; return 0; }

# data[].attributes.body
mohd muizzuddin bin yusman

b011410154

# data[].attributes.body
Question 1 (Hotel occupancy)

Cheong Ming Kit

B011410126

//Cheong Ming Kit B011410126 //Question Number 1 (Hotel Occupancy) #include <iostream> using namespace std; int main() { int floor, numfloor, room1, occupied1, room, occupied, unoccupied, percentage; cout<< "\nHow many floors does the hotel has? "; cin >> numfloor; if (numfloor < 13 && numfloor > 0) { for (int floor = 1; floor <= numfloor ; floor++) { cout << "\nHow many rooms on the " << floor << "# floor? "<< endl;; cin >> room1; cout << "\nHow many of them are occupied? "; cin >> occupied1; } cout<< "Number of rooms in the hotel are " << room <<endl; room = numfloor*room1; cout<< "Number of occupied rooms in the hotel are " <<occupied <<endl; occupied += occupied1; cout<< "Number of unoccupied rooms in the hotel are " << unoccupied <<endl; unoccupied = room - occupied; cout<< "Percentage of number of rooms occupied is " << percentage<<endl; percentage = occupied/room; } else { cout<< "error"; } return 0; }

# data[].attributes.body
B011410197

# data[].attributes.attachment_link.readable_text
//Zulkarnaen bin kalet
// B011410197




#include<iostream>
#include<fstream>
#include<cstdlib>
#include<iomanip>
using namespace std;
int main()
{
char m1,m2,m3,m4,m5;
float number;
string line;

ifstream inputFile("number.txt",ios::in);
if(!inputFile)
{
  cerr<< "File cannot be opened \n";
  exit(1);
}
cout<<m1<<m2<<m3<<m4;
cout<<m5;
while(inputFile>>m1>>m2>>m3>>m4>>m5)
getline(inputFile,line);
{
cout<<m1<<m2<<m3<<m4;
cout<<m5;
}
cout<<endl;
int sum;
int average;
sum=m1+m2+m3+m4+m5;

cout<<sum;
average=sum/5;
cout<<average;
inputFile.close();
return 0;

}







# data[].attributes.body
Mohd Ezwan bin elias B011410265

# data[].attributes.attachment_link.readable_text
#include<iostream>
using namespace std;
int main()

 {
    const int SIZE = 20;
   
    char A, B, C, D;
   
    char correctAnswers[SIZE] = {'B', 'D', 'A', 'A', 'C', 'A', 'B', 'A', 'C', 'D', 'B', 'C', 'D', 'A', 'D', 'C', 'C', 'B', 'D', 'A'};
   
    char userAnswers[SIZE];
    
    char Correctness[SIZE];
    int sum = 0;
    int index, count; 
    int finalcount;

    cout << "Driver's License Exam Grader" << endl;
  
    for (index = 1; index < 21; index++)
    {
        cout << "Enter your answer for question " << index << endl;
        cin >> userAnswers[index];

       
        if (userAnswers[index] != correctAnswers[index])
        {
          
            Correctness[index] = 'W';
        }
        else
        {
          
            Correctness[index] = 'R';
        }
    }
    
   for (index = 1; index < 21; index++)
    {
      
        if (Correctness[index] == 'W')
        {
            cout << "Answer " << index << " is incorrect." << endl;
        }
        else
        {
            sum += 1;
        }
    }

    finalcount = 20 - sum;
    
    cout << "Results (minimum 15 correct to pass):" << endl;
    cout << "You got " << sum << " correct. " << endl;
    cout << "You missed " << (20 - sum) << "." << endl;
    if (sum >= 15)
    {
        cout << "You've passed!" << endl;
    }
    else
    {
        cout << "You've failed." << endl;
    }
	
return 0;
}

# data[].attributes.body
b011410145

# data[].attributes.body
MUHAMMAD AMIR ZIKRI B MAD ZAIDI

# data[].attributes.attachment_link.readable_text
//MUHAMMAD AMIR ZIKRI B MAD ZAIDI
//B011410208

#include<iostream>
using namespace std;
int main()

 {
    const int SIZE = 20;
   
    char A, B, C, D;
   
    char correctAnswers[SIZE] = {'B', 'D', 'A', 'A', 'C', 'A', 'B', 'A', 'C', 'D', 'B', 'C', 'D', 'A', 'D', 'C', 'C', 'B', 'D', 'A'};
   
    char userAnswers[SIZE];
    
    char Correctness[SIZE];
    int sum = 0;
    int index, count; 
    int finalcount;

    cout << "Driver's License Exam Grader" << endl;
  
    for (index = 1; index < 21; index++)
    {
        cout << "Enter your answer for question " << index << endl;
        cin >> userAnswers[index];

       
        if (userAnswers[index] != correctAnswers[index])
        {
          
            Correctness[index] = 'W';
        }
        else
        {
          
            Correctness[index] = 'R';
        }
    }
    
   for (index = 1; index < 21; index++)
    {
      
        if (Correctness[index] == 'W')
        {
            cout << "Answer " << index << " is incorrect." << endl;
        }
        else
        {
            sum += 1;
        }
    }

    finalcount = 20 - sum;
    
    cout << "Results (minimum 15 correct to pass):" << endl;
    cout << "You got " << sum << " correct. " << endl;
    cout << "You missed " << (20 - sum) << "." << endl;
    if (sum >= 15)
    {
        cout << "You've passed!" << endl;
    }
    else
    {
        cout << "You've failed." << endl;
    }
	
return 0;
}

# data[].attributes.body
#include <iostream> using namespace std; int main (); { int aNumber=0; int numbers=0; double sum=0.0; double average=0.0; if stream randomFile; randomFile.open("Random.txt"); if (randomFile.fail()) cout << "failed to read file."; else { while (randomFile >> aNumber) { numbers++; sum+=aNumber; } if (numbers>0) average = sum/numbers; else average=0.0; cout << "Number of numbers: " << numbers << "\n"; cout << "Sum of the numbers: " << sum << "\n"; cout << "Average of the numbers: " << average; } randomFile.close(); return 0; }

# data[].attributes.headline
B011410261 NURUL HUDA HIDAYAT BINTI HASSAN

# data[].attributes.subject
B011410261 NURUL HUDA HIDAYAT BINTI HASSAN

# data[].attributes.headline
mohammad hizbullah dhiauddin b halim b011410164

# data[].attributes.subject
mohammad hizbullah dhiauddin b halim b011410164

# data[].attributes.attachment_link.readable_text
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
string line;
double sum,num1,num2,num3,num4,num5,num6,num7,num8;
double average;

ifstream inputfile("data.txt",ios::in);
if(!inputfile)
{
cout << "no input file\n";
exit(1);
}
while( getline (inputfile,line))
{
sum=num1+num2+num3+num4+num5+num6+num7+num8;
average=sum/8;
}
cout<<"your sum is "<<sum<<endl;
cout<<"your average is "<<average<<endl;

return 0;
}













# data[].attributes.headline
B011410261 NURUL HUDA HIDAYAT BINTI HASSAN

# data[].attributes.subject
B011410261 NURUL HUDA HIDAYAT BINTI HASSAN

# data[].attributes.body
Question 1

# data[].attributes.attachment_link.readable_text
#include <iosream>

usind namespace std;

int main()
{

		int( i=0 , i<11 , i++)//i is the number of the floor//
		{
		 



return 0,
)

# data[].attributes.body
#include<iostream> #include<iomanip> using namespace std; int main () { //variable declaration double noFloors,noRooms,occupRooms,perRooms; double totalRooms; double TotOccupRooms; //inputting total number of floors cout<<"Enter number of floors:"; cin>>noFloors; if (noFloors <1) { cout<<"RE-Enter number of floors:"; cin>>noFloors; } for(int i=0;i<noFloors;i++) { if(noFloors>=13) break; //inputting number of rooms cout<<"Enter number of rooms:"; cin>>noRooms; if(noRooms<10)//validating input for rooms { cout<<"ReEnter number of rooms:"; cin>>noRooms ; } //calculating total no of rooms totalRooms = 0.0; totalRooms = totalRooms + noRooms; //inputting number of occupied rooms cout<<"Enter number of occupied rooms:"; cin>>occupRooms; //calculating total no of occupied rooms TotOccupRooms = 0.0; TotOccupRooms=TotOccupRooms+occupRooms; } //outputting total rooms in Hotel cout<<"Total number of rooms in hotel:"<<totalRooms<<endl; //outputting occupied total cout<<"Occupied Rooms: "<<TotOccupRooms<<endl; //outputting unoccupied rooms cout<<"Un-occupied Rooms: "<<totalRooms-TotOccupRooms <<endl; //calculating percentage perRooms=(TotOccupRooms/totalRooms) *100; cout<<"Percentage of occupied:"<<perRooms<<endl; //pause system for a while system("pause") ; }

# data[].attributes.body
B011410256

# data[].attributes.body
B011410256

# data[].attributes.attachment_link.readable_text
#include <iostream>
using namespace std;
int main ()
 {
//variable declaration

double noFloors,noRooms,occupRooms,perRooms;

double totalRooms;
double TotOccupRooms;

//inputting total number of floors

cout<<"Enter number of floors:";
cin>>noFloors;

if (noFloors <1)
{
cout<<"RE-Enter number of floors:";
cin>>noFloors;
}

for(int i=0;i<noFloors;i++)
{

if(noFloors>=13)
break;
//inputting number of rooms
cout<<"Enter number of rooms:";
cin>>noRooms;

if(noRooms<10)//validating input for rooms
{
cout<<"ReEnter number of rooms:";
cin>>noRooms ;

}

//calculating total no of rooms

totalRooms = 0.0;

totalRooms = totalRooms + noRooms;

//inputting number of occupied rooms

cout<<"Enter number of occupied rooms:";
cin>>occupRooms;

//calculating total no of occupied rooms

TotOccupRooms = 0.0;

TotOccupRooms=TotOccupRooms+occupRooms;

}

//outputting total rooms in Hotel

cout<<"Total number of rooms in hotel:"<<totalRooms<<endl;

//outputting occupied total
cout<<"Occupied Rooms: "<<TotOccupRooms<<endl;

//outputting unoccupied rooms
cout<<"Un-occupied Rooms: "<<totalRooms-TotOccupRooms
<<endl;

//calculating percentage
perRooms=(TotOccupRooms/totalRooms) *100;
cout<<"Percentage of occupied:"<<perRooms<<endl;

//pause system for a while




system("pause") ;
}











 return 0;
 }

# data[].attributes.body
question3

# data[].attributes.attachment_link.readable_text
#include <iostream> 
#include <iomanip> // FOR FORMATING OUTPUT 
using namespace std; 

int main() 
{ 
double wholeSale; 
double markPercent; 
double total; 

double calculateRetail( double, double); // function prototype 



cout << "Enter whole sale price: " << endl; 
cin >> wholeSale; 

if( wholeSale < 0 ) // Test for negative Numbers 
{ 
cout << "ERROR enter postive number" << endl; 
cin >> wholeSale; 
} 

cout << "Enter Marked percent: " << endl; 
cin >> markPercent; 


if(markPercent < 0) 
{ 
cout << "ERROR enter postive number" << endl; 
cin >> markPercent; 
} 

markPercent = markPercent * .01; //so 50 converts to .50 % 


total = calculateRetail(wholeSale, markPercent); // Function call 


cout << fixed << setprecision(2); // used with #include<iomanip> 
// fixed so it for all output 

cout << "Retail Price is " << total; 


return 0; 
} 




double calculateRetail( double num1, double num2) 
{ 

double answer;// local varible its scope is only in the function 

answer = (num1 * num2) + num1; 

return answer; 

}

# data[].attributes.headline
B011410261 NURUL HUDA HIDAYAT BINTI HASSAN

# data[].attributes.subject
B011410261 NURUL HUDA HIDAYAT BINTI HASSAN

# data[].attributes.attachment_link.readable_text
#include <iostream>
using namespace std;

double calculateRetail(double cost, double percentMarkup);

int main()
{ 
	double cost, total, percentMarkup;

	cost = total = percentMarkup = 0.0;

	do
	{
	
	if(cost<0.0)
	
	{
		cout<<"Error! Please enter a NON-Negative value for cost and Try Again\n";
	}

	cout<<"Please Enter the item's wholesale cost: $";
	cin>>cost;
	
	}while(cost<0.0);
    
	do

	{

	if(percentMarkup<0.0)

	{

	cout<<"Error! Please enter a NON-Negative MarkUp percent value for cost and Try Again\n";

	}

	cout<<"Please Enter the item's percent Markup value: ";

	cin>>percentMarkup;

	}while(percentMarkup<0.0);

	total = calculateRetail(cost, percentMarkup);

	cout<<"The item's retail price = $"<<total<<endl;\
	
	return 0;
}

double calculateRetail(double cost, double percentMarkup)

{
   return cost + cost*(percentMarkup/100);
}

# data[].attributes.attachment_link.readable_text
//NURUL MAHFUZA BINTI SAMDIN
//B011410217

#include<iostream>
using namespace std;
int main()

 {
    const int SIZE = 20;
   
    char A, B, C, D;
   
    char correctAnswers[SIZE] = {'B', 'D', 'A', 'A', 'C', 'A', 'B', 'A', 'C', 'D', 'B', 'C', 'D', 'A', 'D', 'C', 'C', 'B', 'D', 'A'};
   
    char userAnswers[SIZE];
    
    char Correctness[SIZE];
    int sum = 0;
    int index, count; 
    int finalcount;

    cout << "Driver's License Exam Grader" << endl;
  
    for (index = 1; index < 21; index++)
    {
        cout << "Enter your answer for question " << index << endl;
        cin >> userAnswers[index];

       
        if (userAnswers[index] != correctAnswers[index])
        {
          
            Correctness[index] = 'W';
        }
        else
        {
          
            Correctness[index] = 'R';
        }
    }
    
   for (index = 1; index < 21; index++)
    {
      
        if (Correctness[index] == 'W')
        {
            cout << "Answer " << index << " is incorrect." << endl;
        }
        else
        {
            sum += 1;
        }
    }

    finalcount = 20 - sum;
    
    cout << "Results (minimum 15 correct to pass):" << endl;
    cout << "You got " << sum << " correct. " << endl;
    cout << "You missed " << (20 - sum) << "." << endl;
    if (sum >= 15)
    {
        cout << "You've passed!" << endl;
    }
    else
    {
        cout << "You've failed." << endl;
    }
	
return 0;
}

# data[].attributes.body
B011410247

# data[].attributes.attachment_link.readable_text
//anis izzaty binti akmaluddin
//B011410247

#include<iostream>
#include<iomanip>
using namespace std;

int main ()
{



double noFloors,noRooms,occupRooms,perRooms;

double totalRooms;
double TotOccupRooms;


cout<<"Enter number of floors:";
cin>>noFloors;

if (noFloors <1)
{
cout<<"RE-Enter number of floors:";
cin>>noFloors;
}

for(int i=0;i<noFloors;i++)
{

if(noFloors>=13)
break;

cout<<"Enter number of rooms:";
cin>>noRooms;

if(noRooms<10)
{
cout<<"ReEnter number of rooms:";
cin>>noRooms ;

}

//calculating total no of rooms

totalRooms = 0.0;

totalRooms = totalRooms + noRooms;

//inputting number of occupied rooms

cout<<"Enter number of occupied rooms:";
cin>>occupRooms;

//calculating total no of occupied rooms

TotOccupRooms = 0.0;

TotOccupRooms=TotOccupRooms+occupRooms;

}

//outputting total rooms in Hotel

cout<<"Total number of rooms in hotel:"<<totalRooms<<endl;

//outputting occupied total
cout<<"Occupied Rooms: "<<TotOccupRooms<<endl;

//outputting unoccupied rooms
cout<<"Un-occupied Rooms: "<<totalRooms-TotOccupRooms
<<endl;

//calculating percentage
perRooms=(TotOccupRooms/totalRooms) *100;
cout<<"Percentage of occupied:"<<perRooms<<endl;




return 0 ;
}



# data[].attributes.body
Write Your Matric No and Name in the header of each file.cpp