0 Replies Latest reply on Sep 25, 2012 6:34 AM by 964153

    Question about proper psuedocode algorithm notation.

      The problem I was given was: Given the length and width of a rectangular yard and the length and the width of a rectangular house situated in the yard. Compute the time required (in minutes) to cut the grass at the rate of 2.3 square meters a second.
      1.) Analyze the problem and write an algorithm (psuedocode) to solve the above problem.

      I'm confused on how I should write the algorithm. I wrote it as:
      Algorithm Rate
      1.) double width,length;
      2.) double width1,length1;
      3.) double area;
      4.) Input width,length,width1,length1;
      5.) area=(width*length)-(width1-length1);
      6.) output area/2.3 * 1/60

      but I'm not sure if its correct to write the algorithm instead like this:
      Algorithm Rate
      1.) Input width,length,width1,length1;
      2.) area=(width*length)-(width1*length1);
      3.) output area/2.3 * 1/60

      any help would be much appreciated