Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculations with Arrays

Status
Not open for further replies.

MinniePerl

Technical User
Apr 19, 2001
7
US
I'm obviously desperate. I'm taking a course that covers "Perl 5 by Example" in two weeks and it's just not sinking in. I can't get the simple homework assignments to work and I don't have a lot of time to spend on this.
Here it is:
Create Perl script that does the following:
1)Usues a Function to ask the user for keyboard input needed to create a standard array that holds inventory data for a business. The user should be able to continue entering data until they choose to end the Data Input. The data should include the following information:
Item Name
Item Price
Number of Items
2)Uses a second Function to calculate the Total Value of each Inventory item entered in the first Function. That Total Value should be Returned to the main program and added to the array line that has that item's other information. Then print the whole array line to the screen. Each print will only be for one line item at a time.

Sample output: ITEM Quantity Price Total
Onions 20 $.50 $10.00

3)Use only private variables in both functions

That's it. Please reply

 
Minnie,

Did you have a specfic problem that you'd like some help with? Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top