I’ve modified the code just a little. There are .upcase , .capitalize , .downcase, if, else, end.
These are new, I’m trying to use what I’ve learned and tweak them a little to do what some times real work requires to do.
1. Try giving fewer than three arguments to your script.
Yes, it will shows up blank. You can use the if else statement to show an error and stop computing the rest of the code by type exit(0).
2.Write a script that has fewer arguments and one that has more, make sure you giv the unpacked variables good names.
Less arguments would cause it blank, more arguments than listed will be ignored.
3. Change your script to use #stdin.gets.chomp everywhere that you have gets.chomp. You should use $stdin.gets.chomp from now on since the action gets.chomp has problems with ARGV.
4.Now that you are using $stdin.gets.chomp (see #3) you can add ARGV to your script ro get something from the user. Don’t over think this. Just use ARGV to get one thing, then $stdin.gets.chomp to get something else.
Done, please look on the code above.