Skip to content

Instantly share code, notes, and snippets.

@ventureproz
Created December 8, 2018 01:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ventureproz/291b1c45ae08538bf89f83f7e8dce4e0 to your computer and use it in GitHub Desktop.
Save ventureproz/291b1c45ae08538bf89f83f7e8dce4e0 to your computer and use it in GitHub Desktop.
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"
#x = gets.chomp
#y = gets.chomp
#puts x+y
# puts "Enter a number to multiply by 2"
# input = gets.chomp
# puts input.to_i * 2
# puts "I am a line"
# puts "-" * 20
# puts "I am a diff line after divider"
# 20.times {puts rand(20) }
# puts 'I am in class = ' + self.class.to_s
# puts 'I am a object = ' + self.to_s
# print 'The object methods are = '
# puts self.private_methods.sort
# # puts self
# 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)
# num_1.to_f + num_2.to_f
# end
# def subtract(num_1, num_2)
# num_1.to_f - num_2.to_f
# end
# def remainder(num_1,num_2)
# num_1.to_f % num_2.to_f
# end
# 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 "The first number multiplied by the second number is #{multiply(num_1,num_2)}"
# puts
# puts "The first number divided by the second number is #{divide(num_1,num_2)}"
# puts
# puts "The first number added to the second number is #{add(num_1,num_2)}"
# puts
# puts "The first number minus the second number is #{subtract(num_1,num_2)}"
# puts
# puts "The remainder of the two numbers diveded together is #{remainder(num_1,num_2)}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment