Skip to content

Instantly share code, notes, and snippets.

View ventureproz's full-sized avatar
🌴
On vacation

ventureproz

🌴
On vacation
View GitHub Profile
puts "simple calculator"
25.times { print "-" }
puts
puts "enter first number"
num_1 = gets.chomp
puts "enter the second number"
num_2 = gets.chomp
puts "what do you want to do"
puts "(M)ultiple, (D)ivide, (S)ubtraction, (A)ddition, (R)emainder"
type = gets.chomp
@ventureproz
ventureproz / gist:0ff842486116013f83990bc577443e97
Created December 8, 2018 01:38
Simple name returned to variable and else and elsif conditionals
puts "what is your name?"
name = gets.chomp
if name == "Zachary"
puts "Welcome to the program future ruby programmer, #{name}"
elsif name == "Melisa"
puts "welcome to the program, Melisa"
else
puts "welcome to the program, #{name}"
end
@ventureproz
ventureproz / gist:291b1c45ae08538bf89f83f7e8dce4e0
Created December 8, 2018 01:22
learning Section 2 Lecture 31 Thus far
# puts "what is your first name"
# first_name = gets.chomp
# puts "what is your first name"
# last_name = gets.chomp
# puts "Your full name is #{first_name} #{last_name}"
# full_name = first_name + " " + last_name
# puts "Your full name reversed is #{first_name.reverse!} #{last_name.reverse!}"
# puts "your name has #{full_name.length - 1} characters in it"
@ventureproz
ventureproz / gist:608132afecd82df3c186b8cb9c43effb
Created December 8, 2018 01:19
Simple Calculator in Ruby
def multiply(num_1, num_2)
num_1.to_f * num_2.to_f
end
def divide(num_1,num_2)
num_1.to_f / num_2.to_f
end
def add(num_1, num_2)
puts "what is your first name"
first_name = gets.chomp
puts "what is your first name"
last_name = gets.chomp
puts "Your full name is #{first_name} #{last_name}"
full_name = first_name + last_name
puts "Your full name reversed is #{first_name.reverse!} #{last_name.reverse!}"
puts "your name has #{full_name.length} characters in it"