Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Dave Rumishek
692 PointsCreating A New Java Program With These.....
So, I'm trying to create a basic program in JAVA that is able to convert American measurements to metric, specifically converting a person's height from feet and inches to meters. Anyway that somebody can help with this?
I'm thinking of it looking like this:
What is your name: Dave What is your height? Feet: 5 Inches: 11
Dave, your height in meters is: 1.8034
2 Answers
Joshua Douce
13,120 PointsHi, you will want to start by creating a class with an appropriate name. Then add some variables you think you may need to store your values. Make sure you consider whether to you use int or floats as this will determine the degree of accuracy you can get. Then add the methods to convert the the different units of measurements. That should give you the basics of the conversion process. Hope this will give you a solid start
Dave Rumishek
692 PointsSo, how would that all look in code format?