Created
December 8, 2018 01:22
-
-
Save ventureproz/291b1c45ae08538bf89f83f7e8dce4e0 to your computer and use it in GitHub Desktop.
learning Section 2 Lecture 31 Thus far
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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