One way to begin attacking a problem is to just start writing down obvious (update: even rather trivial) elements of the problem and general relationships between those elements. Even if it doesn't seem immediately relevant, just write it down. As you begin to see more relationships, write those down (or at least keep them in mind). AnonyMonk has started the process here.

What else springs to mind?

So you might end up with an outline of general relationships like this:
#!/usr/bin/perl use strict; use warnings; my $sold = 10; my $cost = 250; my $price = 300; my $discount = 0.10; my $total_cost = $cost ... $sold ...; my $discounted_price = $price ... $discount ...; my $total_sales = $discounted_price ... $sold ...; my $profit = $total_sales ... $total_cost ...;
Again, as long as they're true, don't worry if some of the statements don't seem immediately relevant or useful; it's easy to delete text. Work on refining relationships that seem useful: exactly what is the relationship of the total cost to the per-item cost and the total made or sold? Continue on to a solution!


Give a man a fish:  <%-{-{-{-<


In reply to Re: Please Help! This is a class assignment given to me. by AnomalousMonk
in thread Please Help! This is a class assignment given to me. by vidyadithya

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.