GeorgeS
07-16-2003, 03:11 AM
Hi Guys
My name is George and im new to the world of c and programming. I joined these forums in the hope that i could expand my knowledge of c and programming and to get tips, help etc.
Im currently in the process of writing, well trying to!, a program which carries out calculations based on the dimensions of a room.
The calculations i need are
area (square meters) of the walls, the door and the window
nett area to be covered by wallpaper
What i have is the following, i was wondering if any 1 could lend a hand and point me in the right direction
#include <stdio.h>
#include <math.h>
int main ( )
{
float v1, v2, v3, v4, v5, v6 , v7;
area;
nett;
*/ Room length, width, height */
printf("Enter the length of the room: ");
scanf("%f", &v1);
printf("Enter the width of the room: ");
scanf("%f", &v2);
printf("Enter the height of the room: ");
scanf("%f", &v3);
*/ Height, width of door */
printf("Enter the height of the door: ");
scanf("%f", &v4);
printf("Enter the width of the door: ");
scanf("%f", &v5);
*/ Height , width of window */
printf("Enter the height of the window: ");
scanf("%f", &v6);
printf("Enter the width of the window: ");
scanf("%f", &v7);
*/ Area of the walls, the door and the window */
area = 2 * (v1 * v3) + (v2 * v3)
printf("The total area is: %0.2f\n", area);
*/ Nett area to be covered by wallpaper */
nett = 2 * v2
printf("The nett area to be covered by wall paper is: %.2f\n, nett);
thanks guys
appreciate it
Best
George
My name is George and im new to the world of c and programming. I joined these forums in the hope that i could expand my knowledge of c and programming and to get tips, help etc.
Im currently in the process of writing, well trying to!, a program which carries out calculations based on the dimensions of a room.
The calculations i need are
area (square meters) of the walls, the door and the window
nett area to be covered by wallpaper
What i have is the following, i was wondering if any 1 could lend a hand and point me in the right direction
#include <stdio.h>
#include <math.h>
int main ( )
{
float v1, v2, v3, v4, v5, v6 , v7;
area;
nett;
*/ Room length, width, height */
printf("Enter the length of the room: ");
scanf("%f", &v1);
printf("Enter the width of the room: ");
scanf("%f", &v2);
printf("Enter the height of the room: ");
scanf("%f", &v3);
*/ Height, width of door */
printf("Enter the height of the door: ");
scanf("%f", &v4);
printf("Enter the width of the door: ");
scanf("%f", &v5);
*/ Height , width of window */
printf("Enter the height of the window: ");
scanf("%f", &v6);
printf("Enter the width of the window: ");
scanf("%f", &v7);
*/ Area of the walls, the door and the window */
area = 2 * (v1 * v3) + (v2 * v3)
printf("The total area is: %0.2f\n", area);
*/ Nett area to be covered by wallpaper */
nett = 2 * v2
printf("The nett area to be covered by wall paper is: %.2f\n, nett);
thanks guys
appreciate it
Best
George