Question: Change the code provided to: Please provide the full code as the final answer. Any deviation or changes from this request will result in a

Change the code provided to:

Change the code provided to: Please provide the full code as the

Please provide the full code as the final answer. Any deviation or changes from this request will result in a report! Provided Code:

bill_total.rb:

require 'date'

INCHES = 39.3701 # This is a global constant

# Insert the missing code here into the statements below:

# gets()

# gets.chomp()

# Date.today.year

# year_born.to_i()

# gets.to_f()

def hello()

puts('What is your name?')

name =

puts('Your name is ' + name + '!')

puts('What is your family name?')

family_name =

puts('Your family name is: ' + family_name + '!')

puts('What year were you born?')

year_born =

# Calculate the users age

age =

puts('So you are ' + age.to_s + ' years old')

puts('Enter your height in metres (i.e as a float):')

value = # Should this be a float or an Integer? Why?

value = value * INCHES

puts('Your height in inches is:')

puts(value.to_s())

puts('Finished')

end

def main()

hello()

end

main()

Change the code provided to: Read the user's name (a String, prompt with 'What is your name?') and store it in the name variable Print out the user's name followed by an exclamation mark. Read the user's family name, remove any white space and store it in the family_name variable. Print out the user's family_name followed by an exclamation mark. Read in the user's year of birth Convert the year of birth to an integer then calculate the user's age and print it out. Prompt for and read in the user's height in metres Convert the height to inches and print out the result

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!