The process of finding the largest value is used frequently in computer applications.
Hi,
I need help completing my Ruby Programming assignment.
The assignment is:
The process of finding the largest value is used frequently in computer applications. For example, a program that determines the winner of a sales contest would input
the number of units sold by each salesperson. The salesperson who sells the most units wins the contest. Make a Ruby application that allows a user to input a series of 10 integers and determines and prints the largest integer. Your program should use at least the following three variables:
a) counter: A counter to count to 10 (i.e., to keep track of how many numbers have been input and to determine when all 10 numbers have been processed).
b) number: The integer most recently input by the user.
c) largest: The largest number found so far.
This is what I have so far:
class Screen
def cls
puts (“n” * 25)
puts “a”
end
def pause
STDIN.gets
end
end
class Program
def display_instructions
Console_Screen.cls
puts “INSTRUCTIONS:nn”
puts “Enter 10 numbers for the program to choose the largest
one.”
print “Press Enter to continue.”
Console_Screen.pause
end
def get_numbers
numbers = []
$counter = 0
$number = numbers.last
$largest = numbers.max
Console_Screen.cls
print “nPlease enter a number and press Enter. “
input = STDIN.gets
input.chop!
while counter < 10
print “last number entered is: #{$number} “
print “The largest number entered is: #{$largest}”
if counter < 10
print %Q{Type a number. (Press Enter)nn: }
input = STDIN.gets
numbers.push = input
$counter += 1
else counter >= 10
puts “The End.”
end
end
end
end
________________________
Could you please help me out?
Thank you.

How it Works

1
It only takes a couple of minutes to fill in your details, select the type of paper you need (essay, term paper, etc.), give us all necessary information regarding your assignment.


2
Once we receive your request, one of our customer support representatives will contact you within 24 hours with more specific information about how much it'll cost for this particular project.


3
After receiving payment confirmation via PayPal or credit card – we begin working on your detailed outline, which is based on the requirements given by yourself upon ordering.


4
Once approved, your order is complete and will be emailed directly to the email address provided before payment was made!