Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

x.Hmtill didn\'t get the output correct this is example for the output what it s

ID: 3617568 • Letter: X

Question

x.Hmtill didn't get the output correct this is example for the output what it should be like along with the program requierment : 1. I need to declear at least 2 constants that I couldn't figure out which are the two should be decleared.

Write a program that estimates the number of boxes of tile for a job. A job is estimated by taking the dimensions of each room in feet and inches, and converting these dimensions into a multiple of the tile size (rounding up any partial multiple) before multiplying to get the number of tiles for the room. A box contains 20 tiles, so the total number needed should be divided by 20 and rounded up to get the number of boxes. The tiles are assumed to be square.
The program should initially prompt the user for the size of the tile in inches and the number of rooms to be covered with tile. It should then input the dimensions for each room and output the number of tiles needed for that room. After data for the last room is input, the program should output the total number of tiles needed, the number of boxes of tile needed, and how many extra tiles will be left over. output : Enter number of rooms: 0 Number of rooms must be greater than 0. Enter number of rooms: 0 Number of rooms must be greater than 0. Enter number of rooms: 2 enter size of tile in inches: 1 Tile size should be between 2 and 24. Enter size of tile in inches: 25 Tile size should be between 2 and 24. Enter size of tile in inches: 12 Enter room width (feet and inches, separated by a space): 17 17 Number of inches must be less than 12 Enter room width (feet and inches, separated by a space): 17 20 Number of inches must be less than 12 Enter room width (feet and inches, separated by a space):17 4 Enter room length (feet and inches, separated by a space): 9 3 Room requires 180 tiles. Enter room width (feet and inches, separated by a space): 11 6 Enter room length (feet and inches, separated by a space): 11 9
Room requires 144 tiles. ****************************************************** Total tiles required is 324. Number of boxes needed is 17. There will be 16 extra tiles. This is my code it could be something wrrong with calculating total tiles and number of boxes needed!!! #include<iostream>

using namespace std;



void PrintPurpose();
void PrintResults( int, int, int);
void GetRoomDimension(int&, int&, int&, int&);
int ComputeNumberOfTiles(int, int,int, int, int);
int GetNumberOfRoom();
int GetTilesSize();


int main()
{

    PrintPurpose();
    int count,rooms,tileSize, wFt, wIn, lFt, lIn, TotTiles, roomTiles,numBoxes;
    int boxes,extra;
        count=0;
        rooms= GetNumberOfRoom();
        while(count< rooms)
        {
          GetRoomDimension(wFt, wIn, lFt, lIn);
          tileSize= GetTilesSize();
          roomTiles= ComputeNumberOfTiles(wFt, wIn, lFt, lIn, tileSize);   
          TotTiles+= roomTiles;
          cout<< "Room requires "<< roomTiles <<endl;
          count++;     
         }


        numBoxes= TotTiles/20;
        extra= TotTiles%20;
        if(extra!=0)
            numBoxes++;
        PrintResults(TotTiles,numBoxes,extra);
        return 0;

     

}    



void PrintResults(int TotTiles, int numBoxes, int extra)
    {
        cout<<"Total tiles required is:"<< TotTiles<<endl;
        cout<<"Number of boxes needed is:"<<numBoxes <<endl;
        cout<<"There will be "<<extra<<" extra tiles. ";     
    }

void PrintPurpose()
{
        cout<<"This program computes the number of tiles, the number of boxes of tile for a job"<<endl;
}



int ComputeNumberOfTiles(int widthft,int widthin, int lengthft, int lengthin, int tileSize)
{
       int length, width, roomarea,need,tilearea;
        double needed;
        length= lengthft*12 +lengthin;
        width= widthft*12 + widthin;
        roomarea= length*width;     
        tilearea= tileSize*tileSize;     
        need= roomarea/tilearea;
        needed= (double)roomarea/tilearea;     
        if(need!= needed)     
            need++;
        return need;
    }



void GetRoomDimension(int& wft, int& win, int& lft,int& lin)
    {
        cout<<"Enter room width(feet and inches, separated be a space):";
        cin>> wft>>win;   
        if(wft<= 0|| win< 0|| win>12)
        {
            cout<<"Invalid entry ";
            cout<<"Enter room width(feet and inches, separated be a space):";
            cin>>wft>>win;
        }
        cout<<"Enter room lengh(feet and inches, separated by a space):";
        cin>> lft>>lin;
       if(lft<=0|| lin<0|| lin>12)
       {
           cout<<"Inv 1. I need to declear at least 2 constants that I couldn't figure out which are the two should be decleared.
Write a program that estimates the number of boxes of tile for a job. A job is estimated by taking the dimensions of each room in feet and inches, and converting these dimensions into a multiple of the tile size (rounding up any partial multiple) before multiplying to get the number of tiles for the room. A box contains 20 tiles, so the total number needed should be divided by 20 and rounded up to get the number of boxes. The tiles are assumed to be square.
The program should initially prompt the user for the size of the tile in inches and the number of rooms to be covered with tile. It should then input the dimensions for each room and output the number of tiles needed for that room. After data for the last room is input, the program should output the total number of tiles needed, the number of boxes of tile needed, and how many extra tiles will be left over. output : Enter number of rooms: 0 Number of rooms must be greater than 0. Enter number of rooms: 0 Number of rooms must be greater than 0. Enter number of rooms: 2 Number of rooms must be greater than 0. Enter number of rooms: 0 Number of rooms must be greater than 0. Enter number of rooms: 2 enter size of tile in inches: 1 Tile size should be between 2 and 24. Enter size of tile in inches: 25 Tile size should be between 2 and 24. Enter size of tile in inches: 12 Enter room width (feet and inches, separated by a space): 17 17 Number of inches must be less than 12 Enter room width (feet and inches, separated by a space): 17 20 Number of inches must be less than 12 Enter room width (feet and inches, separated by a space):17 4 Enter room length (feet and inches, separated by a space): 9 3 Room requires 180 tiles. Enter room width (feet and inches, separated by a space): 11 6 Enter room length (feet and inches, separated by a space): 11 9
Room requires 144 tiles. ****************************************************** Total tiles required is 324. Number of boxes needed is 17. There will be 16 extra tiles. This is my code it could be something wrrong with calculating total tiles and number of boxes needed!!! #include<iostream>

using namespace std;



void PrintPurpose();
void PrintResults( int, int, int);
void GetRoomDimension(int&, int&, int&, int&);
int ComputeNumberOfTiles(int, int,int, int, int);
int GetNumberOfRoom();
int GetTilesSize();


int main()
{

    PrintPurpose();
    int count,rooms,tileSize, wFt, wIn, lFt, lIn, TotTiles, roomTiles,numBoxes;
    int boxes,extra;
        count=0;
        rooms= GetNumberOfRoom();
        while(count< rooms)
        {
          GetRoomDimension(wFt, wIn, lFt, lIn);
          tileSize= GetTilesSize();
          roomTiles= ComputeNumberOfTiles(wFt, wIn, lFt, lIn, tileSize);   
          TotTiles+= roomTiles;
          cout<< "Room requires "<< roomTiles <<endl;
          count++;     
         }


        numBoxes= TotTiles/20;
        extra= TotTiles%20;
        if(extra!=0)
            numBoxes++;
        PrintResults(TotTiles,numBoxes,extra);
        return 0;

     

}    



void PrintResults(int TotTiles, int numBoxes, int extra)
    {
        cout<<"Total tiles required is:"<< TotTiles<<endl;
        cout<<"Number of boxes needed is:"<<numBoxes <<endl;
        cout<<"There will be "<<extra<<" extra tiles. ";     
    }

void PrintPurpose()
{
        cout<<"This program computes the number of tiles, the number of boxes of tile for a job"<<endl;
}



int ComputeNumberOfTiles(int widthft,int widthin, int lengthft, int lengthin, int tileSize)
{
       int length, width, roomarea,need,tilearea;
        double needed;
        length= lengthft*12 +lengthin;
        width= widthft*12 + widthin;
        roomarea= length*width;     
        tilearea= tileSize*tileSize;     
        need= roomarea/tilearea;
        needed= (double)roomarea/tilearea;     
        if(need!= needed)     
            need++;
        return need;
    }



void GetRoomDimension(int& wft, int& win, int& lft,int& lin)
    {
        cout<<"Enter room width(feet and inches, separated be a space):";
        cin>> wft>>win;   
        if(wft<= 0|| win< 0|| win>12)
        {
            cout<<"Invalid entry ";
            cout<<"Enter room width(feet and inches, separated be a space):";
            cin>>wft>>win;
        }
        cout<<"Enter room lengh(feet and inches, separated by a space):";
        cin>> lft>>lin;
       if(lft<=0|| lin<0|| lin>12)
       {
           cout<<"Inv #include<iostream>

using namespace std;



void PrintPurpose();
void PrintResults( int, int, int);
void GetRoomDimension(int&, int&, int&, int&);
int ComputeNumberOfTiles(int, int,int, int, int);
int GetNumberOfRoom();
int GetTilesSize();


int main()
{

    PrintPurpose();
    int count,rooms,tileSize, wFt, wIn, lFt, lIn, TotTiles, roomTiles,numBoxes;
    int boxes,extra;
        count=0;
        rooms= GetNumberOfRoom();
        while(count< rooms)
        {
          GetRoomDimension(wFt, wIn, lFt, lIn);
          tileSize= GetTilesSize();
          roomTiles= ComputeNumberOfTiles(wFt, wIn, lFt, lIn, tileSize);   
          TotTiles+= roomTiles;
          cout<< "Room requires "<< roomTiles <<endl;
          count++;     
         }


        numBoxes= TotTiles/20;
        extra= TotTiles%20;
        if(extra!=0)
            numBoxes++;
        PrintResults(TotTiles,numBoxes,extra);
        return 0;

     

}    



void PrintResults(int TotTiles, int numBoxes, int extra)
    {
        cout<<"Total tiles required is:"<< TotTiles<<endl;
        cout<<"Number of boxes needed is:"<<numBoxes <<endl;
        cout<<"There will be "<<extra<<" extra tiles. ";     
    }

void PrintPurpose()
{
        cout<<"This program computes the number of tiles, the number of boxes of tile for a job"<<endl;
}



int ComputeNumberOfTiles(int widthft,int widthin, int lengthft, int lengthin, int tileSize)
{
       int length, width, roomarea,need,tilearea;
        double needed;
        length= lengthft*12 +lengthin;
        width= widthft*12 + widthin;
        roomarea= length*width;     
        tilearea= tileSize*tileSize;     
        need= roomarea/tilearea;
        needed= (double)roomarea/tilearea;     
        if(need!= needed)     
            need++;
        return need;
    }



void GetRoomDimension(int& wft, int& win, int& lft,int& lin)
    {
        cout<<"Enter room width(feet and inches, separated be a space):";
        cin>> wft>>win;   
        if(wft<= 0|| win< 0|| win>12)
        {
            cout<<"Invalid entry ";
            cout<<"Enter room width(feet and inches, separated be a space):";
            cin>>wft>>win;
        }
        cout<<"Enter room lengh(feet and inches, separated by a space):";
        cin>> lft>>lin;
       if(lft<=0|| lin<0|| lin>12)
       {
           cout<<"Inv

Explanation / Answer

please rate - thanks #include using namespace std; # define BOX 20 # define INCHES 12 void PrintPurpose(); void PrintResults( int, int, int); void GetRoomDimension(int&, int&, int&, int&); int ComputeNumberOfTiles(int, int,int, int, int); int GetNumberOfRoom(); int GetTilesSize(); int main() {   PrintPurpose();     int count,rooms,tileSize, wFt, wIn, lFt, lIn,TotTiles, roomTiles,numBoxes;     int boxes,extra;                count=0;         rooms=GetNumberOfRoom();         tileSize=GetTilesSize();         while(count