artemisc360
and many others are using
Hackety Hack
to learn how to code.
Hackety Hack is a free program for Windows, Mac OS X and Linux that can teach you how to make games, applications and more and share those programs with your friends. You can ask other budding programmers questions and follow them to see what code they're working on through the Hackety Hack website.
Sign up
Learn More
Shoes.app do
para ' Give me any piece of info on a circle and I will calculate all other data points. To use circumference enter "C" then press enter and then enter the circumference. Use "R" and "A" for radius and area of the circle respectively. So, enter "C", "R", or "A" to get started.'
button "Push to start" do
datatype = ask "Please enter the data type you would like to use"
if datatype == 'C'
value1 = ask "What is the value for the circumference?"
stack do
para 'The circles properties are listed below:'
para 'RADIUS: ' + ((((value1.to_i)/3.14)/2)).to_s + ' units'
para 'DIAMETER: ' + (value1.to_i/3.14).to_s + ' units'
para 'AREA: ' + ((((value1.to_i/3.14)/2)**2)* 3.14).to_s + ' square units'
end
else
if datatype == 'R'
value2 = ask "What is the value for the radius?"
stack do
para 'The circles properties are listed below:'
para 'DIAMETER: ' + (value2.to_i * 2).to_s + ' units'
para 'CIRCUMFERENCE: ' + ((value2.to_i * 2) * 3.14).to_s + ' units'
para 'AREA: ' + ((value2.to_i**2) * 3.14).to_s + ' square units'
end
else
if
datatype == 'A'
value3 = ask "What is the value for the area?"
stack do
para 'The circles properties are listed below: '
para 'RADIUS: ' + (Math.sqrt(value3.to_i/3.14)).to_s + " units"
para 'DIAMETER: ' + ((Math.sqrt(value3.to_i/3.14)) * 2).to_s + " units"
para 'CIRCUMFERENCE: ' + (((Math.sqrt(value3.to_i/3.14)) * 2) * 3.14).to_s + " units"
end
else
para datatype + ' is not a recognizable data point type. Please run the program again.'
end
end
end
end
end