Thanks eveyerone for giveing me some idea's to try and I'll try them. The code it runs now. **** IT RUNS LIKE THIS
Input room dimensions
Length? ( I enter 12 )
Width? ( I enter 10)
Height? ( I enter 8)
MY Answer = You will need the following amount of paint in gallons: 3
Press any key to continue ….
But I need it to say ( You will need the following amount of paint in gallons: 3.25 ) So I almost have it an I’ll try u’er ideas.
#include <conio.h>
#include <iostream>
#include <stdio.h>
#define N_DECIMAL_POINTS_PRECISION (100) // n = 2. two decimal points.
using namespace std;
void main (void)
{
int paint_cover = 100.0;
int exc_area1 = 27.0;
float length, width, height;
int wall_area;
int cans;
printf ("Input room dimensions\n");
printf ("length? ");
scanf ("%f", &length);
printf ("width? ");
scanf ("%f", &width);
printf ("height? ");
scanf ("%f", &height);
wall_area = ((length + length + width + width) * height) - exc_area1;
//wall_area = ((2*length) + (2*width) *8) - exc_area1;
cans = (wall_area / paint_cover) + 0.999;
cout << "You will need the following amount of paint in gallons: " << cans <<endl;
//printf ("You need = %d\n", "cans of paint");
system("pause");
}