digits = -1..9 puts digits.min puts digits.max What will be the output from the code above ?
marks = -85 case marks when 0..59 puts “You got an F” when…
marks = -85 case marks when 0..59 puts “You got an F” when 60..69 puts “You got a D grade !” when 70..79 puts “You got a C grade!” when 80..89 puts “You got a B grade!” else puts “You got an A grade!” end What will be the output when marks = -85 ?
taxrate = 0.125print “Enter price: “s = getssubtotal = s.to_…
taxrate = 0.125print “Enter price: “s = getssubtotal = s.to_fif (subtotal < 0.0) then subtotal = 0.0endtax = subtotal * taxrateputs "Tax on $#{subtotal} is $#{tax}, so grand total is $#{subtotal+tax}" The end keyword that terminates the if block is optional in the code above.
Variables in Ruby can be embedded into the string itself by…
Variables in Ruby can be embedded into the string itself by using #{variable_name}.
for num in 1..5 puts num*num endWhat is the output from the…
for num in 1..5 puts num*num endWhat is the output from the code ?
Ruby is case sensitive.
Ruby is case sensitive.
What is your favorite aspect of the course so far?
What is your favorite aspect of the course so far?
Select all correct answers. The causes of the current (sixth…
Select all correct answers. The causes of the current (sixth) mass extinction include all of the following:
Detritivores include ________.
Detritivores include ________.
Nitrogen fixation is a process that makes nitrogen available…
Nitrogen fixation is a process that makes nitrogen available to plants and is carried out by ________.