write a program that reads in the length and the width of a rectangular yard . your program should compute the time required ( in minutes ) to cut the grass at the rate of 2.3 square meters a second

Respuesta :

Here's on C:
#include<stdlib.h> 
#include<stdio.h> 
#include<conio.h> 
long YardArea=0,HouseArea=0; 
int YardLength=0,YardWidth=0,HouseLength=0,HouseWidth=0; 
long GroundArea=0; 
int TimeReqierd=0; 
int GrassCutRate=2; 
void main() 

char inp[256]; 
clrscr(); 
printf("your text text\n");  // put your greetings
printf("Input the leght of the yard\n"); 
gets(inp); 
YardLength= atoi(inp); 
printf("input the width of the yard\n"); 
         gets(inp); 
YardWidth=atoi(inp); 
    printf("input the length of the house\n"); 
         gets(inp); 
HouseLength=atoi(inp); 
   printf("input the width of the house\n"); 
         gets(inp); 
HouseWidth=atoi(inp); 
HouseArea=HouseWidth *HouseLength ; 
YardArea=YardWidth* YardLength; 
GroundArea=YardArea-HouseArea; 
   TimeReqierd=GroundArea/GrassCutRate; 
printf("%s%d","Grass Area is ",GroundArea); 
printf("%s%d seconds"," \n time required to cut it out " ,TimeReqierd); 
getchar();