From: Mariam Tariq Date: 2010-11-03T22:52:52+09:00 Subject: Re: Getting Hash to print and work with numbers --0016364d26cf38da6a0494265b4b Content-Type: text/plain; charset=ISO-8859-1 Hi, you have a lowercase p in a = Company['Emp01']['*p*ayrate'] thats why it is not working On 3 November 2010 13:37, Sean Raw wrote: > Hello everyone. Just curious about some code that I was writing. Just > trying to learn anyones input would be very helpful. Can't figure out > how to make this work. > Here it is thank you. > > > Company = { > 'Emp01' => { > 'Name' => 'John Smith', > 'Age' => '55', > 'Payrate' => 5.75, > 'Hours_worked' => 35, > 'Marital_s' => 'S' > }, > 'Emp02' => { > 'Name' => 'Jack Smith', > 'Age' => '25', > 'Payrate' => 25.76, > 'Hours_worked' => 60, > 'Marital_s' => 'M' > }, > } > p Company['Emp01']['Age'] > a = Company['Emp01']['payrate'] > b = Company['Emp01']['Hours_worked'] > z = a * b > p z > > -- > Posted via http://www.ruby-forum.com/. > > --0016364d26cf38da6a0494265b4b--