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

Write a program that calculates how long it will take to mow a rectangular yard.

ID: 3527960 • Letter: W

Question

Write a program that calculates how long it will take to mow a rectangular yard. Prompt the user for the length and width of the lot and also the length and width of the house. Assume that the entire lot, except for the area occupied by the house is to be mowed. Also ask for the mowing rate. From that information, calculate the number of hours (a whole number) and minutes it will take to mow. A sample session should look something like this:

Explanation / Answer

m doing in C #include int main() { int lenthy,widthy,lengthh,widthh,areay,areah,hrs; double mowrate,totaltime,mins; printf(" Enter the length of the yard in metres "); scanf("%d",&lengthy); printf(" Enter the with of the yard in metres "); scanf("%d",&widthy); printf(" Enter the length of the house in metres "); scanf("%d",&lengthh); printf(" Enter the width of the housein metres n"); scanf("%d",&widthh); printf(" Enter the mowing rate in square metres per minutes n"); scanf("%f",&mowrate); areay = lengthy*widthy; areah = lengthh*widthh; if(areah>=areay) printf(" Not possible to mow as area of house in else "); else { int effarea = areay - areah; totaltime = (double)effarea/mowrate; hrs = (int)totaltime/60; mins = totaltime - (float)(hrs*60); printf("Time for mowing an area %d = %d hrs %f mins",effarea,hrs,mins); } return(0); }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote