Python Forum
HI I am new and I need help..
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HI I am new and I need help..
#1
Ihave to write a program that requests the price and weight of an item in pounds and ounces and then determines the price per ounce. This is going to take me all day.
so far
in the IPO process
I have:

Enter the price of item

Enter weight in pounds and ounces separately

Enter pounds
Enter ounces

Price per ounce

What I need to know if I have the math right for the Process part of the code.
But I need to make sure. I have a math disability due to epilepsy, so I mess up in math a lot.

so far I think I have to divide total price of the item and divide it by pounds then convert to ounces. Is this correct. ( this is homework, so I don't expect for anyone to write a code, all I need to know if I am on the right track) Thank you
Reply
#2
The final ratio you want is Price Per Ounce.  If you look at it like division, then that's Price / Ounces.  One of those numbers should be a price, and the other should be ounces.  If you're getting a price per pound, and then trying to extrapolate that to what it'd mean per ounce, it'd still work.

The first thing you should do, is try to change your units to be whatever you want at the end.  You're given a price, so you don't need to touch that.  But if you have pounds, then the very first thing you should do is convert that to just be ounces.  Then, the price per ounce is simply whatever price you're given divided by however many ounces you calculated.
Reply
#3
Did you figure this out?

There are 16 ounces in a pound, so you should multiple the number of pounds entered by 16 and add the total to the number of ounces entered.

You should divide the price entered by the total number of ounces you calculated to give you the price per ounce.

Thus, given:

Price: £9.62

Pounds: 4
Ounces: 10

You have: 9.62 / 74 = 13 i.e. 13 pence per ounce.
I am trying to help you, really, even if it doesn't always seem that way
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020