Showing posts with label Display Names in Reverse Order Using One-Dimensional Array in Ruby. Show all posts
Showing posts with label Display Names in Reverse Order Using One-Dimensional Array in Ruby. Show all posts

Sunday, June 30, 2019

Display Names in Reverse Order Using One-Dimensional Array in Ruby

A simple program that I wrote that will ask the user to give five names of the person that will be stored in a one-dimensional array and then the program will display the list of given names of the user in reverse order.

If you like my work please click the ads on my website to support my work. I will really appreciate your help. 

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Program Listing

# sample3.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 30, 2019  Sunday  3:15 PM
# Address  : Bacolod City, Negros Occidental
# Tools    : Eclipse IDE and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmail.com and jakerpomperada@yahoo.com
puts "\n\n"
print "\tDisplay Names in Reverse Order Using One-Dimensional Array";
puts "\n\n"
name = []
puts "\tGive Five Names : "
5.times do |x|
name[x] = gets.chomp
end
puts("\n");
print "\t===== DISPLAY RESULT ====="
print "\n";


for i in 4.downto 0
  print("\n");
print("\t #{name[i].upcase}")
end
print "\n\n";
print "\tEND OF PROGRAM";