Ignoramus needs help with a simple Lawmowing Program.

This is a discussion on Ignoramus needs help with a simple Lawmowing Program. within the C Programming forums, part of the General Programming Boards category; Hey everyone, I need help with the next part of my homework. I'm trying to use scanf to read two ...

  1. #1
    Registered User
    Join Date
    Oct 2012
    Posts
    33

    Ignoramus needs help with a simple Lawmowing Program.

    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]$

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    2,769
    FAQ > How do I get a number from the user (C) - Cprogramming.com

    The last time I help you directly because there was no FAQ that would help.

    Read the FAQ and try to write the program.

    Tim S.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    2,695
    Please show your code so that we might offer insight into your plight.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ignoramus needs help with a Simple Grade program.
    By Kurtanius21 in forum C Programming
    Replies: 7
    Last Post: 10-08-2012, 10:07 PM
  2. Simple program, simple problem
    By KAUFMANN in forum C Programming
    Replies: 5
    Last Post: 02-16-2011, 01:16 PM
  3. simple program, simple error? HELP!
    By colonelhogan44 in forum C Programming
    Replies: 4
    Last Post: 03-21-2009, 12:21 PM
  4. Simple program...simple problem?
    By deadherorising in forum C Programming
    Replies: 2
    Last Post: 03-12-2009, 09:37 PM
  5. Simple program, not so simple problem
    By nolsen in forum C++ Programming
    Replies: 2
    Last Post: 01-18-2008, 10:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21