Hey everyone, I need help with the next part of my homework. I'm trying to use scanf to read two values. The problem is the user input must match the assignment perfectly. As you can see the request for information requires both width and length placed after a single prompt. So how can I go about doing this? I have no clue where to start. Thanks!
#9. Filename: grass.c “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.” The numbers are integers.
[ssdavis@lect2 p1]$ grass.out
Please enter the length and width of the yard > 100 95
Please enter the length and width of the house > 45 38
7790 square feet will take 64 minutes and 55 seconds to cut.
[ssdavis@lect2 p1]$
[ssdavis@lect2 p1]$ grass.out
Please enter the length and width of the yard > 40 70
Please enter the length and width of the house > 38 62
444 square feet will take 3 minutes and 42 seconds to cut.
[ssdavis@lect2 p1]$