Need help with a C assignment due on 9/23 (Friday)

• 09-22-2005
JohnnyBoy268
Need help with a C assignment due on 9/23 (Friday)
Hi I've never posted before on this board. (actually, I've just now signed up). But anyways; I need help with a homework assignment that will probably seem extremely easy to everyone here, I've never done any programming of any sort before so I was wondering if someone could show me how to do this.

John Putnam

The question:
Write a program that takes the length and width of a rectangular yard and the length and width of a rectangular house situated in the yard. Your program should compute the time required to cut the grass at the rate of two square feet a second.
• 09-22-2005
XSquared
We're not going to write your code for you. If you're having trouble, post what you have, and we'll help you out.
• 09-22-2005
JohnnyBoy268
thanks
i will try to but like i said i dont even know how to start this. This is what I currently have done:

/*Assignment 2
Written By John Putnam
September 2005
*/

#include <stdio.h>
int main<void>
{
printf<"Input Length of yard\n">;
scanf< >;
printf<"Input Width of yard\n">;
scanf< >;
printf<"Input Length of House\n">;
scanf< >;
printf<"Input Width of House\n">;
scanf< >

That's all I have I dont think its even close to being right, and I dont know how to proceed, this has taken me a week to get this far!!! PLEASE HELP!!!
• 09-22-2005
Tonto
It should not take you a week to do something like this. Surely, you have the internet, and potentially a good text and teacher at your fingertips. You are mixing up <> and () with function definitions/calls. Check out this very simple tutorial on the subject of console interaction: http://computer.howstuffworks.com/c7.htm
• 09-22-2005
sean
Tonto - excellent tutorial recommendation!

JohnnyBoy268 - please read the forum guidelines, located at http://cboard.cprogramming.com/annou...ouncementid=51. Please also refer to the sticky at the top of each forum concerning the proper way to post code.

I hesitate to tell you that had you followed the guideline regarding searching the forums, you would have found how many other people are working on this same assignment.
• 09-22-2005
csisz3r
After that, you should find the area of both rectangles (the yard and the house) using the formula area = length * width . Then you need to subtract the area of the house from the area of the yard to get the total grass.
• 09-23-2005
Salem
> this has taken me a week to get this far!
And now with less than 24 hours to go, you post a panic message saying "please help".

> printf<"Input Length of yard\n">;
Jeez, someone else used () to include a file, and now you're using <> to call a function.