CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner: Re: [Laurent_R] Hopelessly stuck on an assignment: Edit Log

New User

Oct 30, 2012, 4:14 PM

Views: 3765
Re: [Laurent_R] Hopelessly stuck on an assignment

Thank you guys for your input about better practices. For this program, the final product must look just like this:

Qty       Desc.       Unit $    Total 
2 Hamburger 3.49 6.98
1 Large Coke 1.79 1.79
Total 8.77

I think I am most puzzled about the "quantity" array I have to use. This program is actually an advanced version of an earlier one. In that one, I had a variable called $tally that would simply add the total up each time the user added an item. Now I tried to figure out a way to tally up the total after a user selects items and the quantity they want... and it also has to be formatted with printf to look just right :(

I looked at the instructions again - apparently, I can get away with not using the @quantity array in such a tricky manner. I'll just have it add one each time the user selects the given item. That'll make things a bit more manageable. Still doesn't totally resolve the printf formatting, though.

(This post was edited by human on Oct 30, 2012, 4:29 PM)

Edit Log:
Post edited by human (New User) on Oct 30, 2012, 4:29 PM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives