Ruby excercises (ARRAY)
1. Write a Ruby program that receives an array of student exam scores. For each score, classify and store the grade as "A" if the score is 90 or above, "B" if it's between 80 and 89, "C" for scores between 70 and 79, and "D" for scores below 70.
2. Create a Ruby script that takes an array of daily temperatures. For each day, output "High" if the temperature is above 35 degrees Celsius, "Moderate" if it's between 20 and 35 degrees, and "Low" if it's below 20 degrees.
3. Develop a Ruby program that receives an array of ages and counts how many individuals fall into each age group: "Child" (12 or younger), "Teenager" (13 to 19), and "Adult" (20 or older).
4. Write a Ruby script that takes an array of integers. For each number, determine and store whether it's positive, negative, or zero.
5. Create a Ruby program that accepts an array of purchase amounts. For each purchase, apply a 15% discount if the amount is greater than $100, a 10% discount if it's between $50 and $100, and no discount if it's below $50. Store the discounted amounts in a new array.
6. Write a Ruby program that receives an array of product quantities. For each product, if the quantity is greater than 50, mark it as "In Stock"; otherwise, mark it as "Low Stock."
7. Create a Ruby script that takes an array of student exam results, represented as percentages. For each result, classify and store it as "Pass" if the percentage is 50 or above, and "Fail" otherwise.
8. Develop a Ruby program that receives an array of daily weather conditions. For each day, output "Sunny" if the conditions include the keyword "sun," "Rainy" if it includes "rain," and "Cloudy" otherwise.
9. Write a Ruby script that takes an array of integers. For each number, determine and store whether it's positive, negative, or zero. If the number is positive, append "Positive" to the result; for negative numbers, append "Negative"; for zero, append "Zero."
10. Create a Ruby program that accepts an array of purchase amounts. For each purchase, apply a $20 discount if the amount is greater than $150, a $10 discount if it's between $75 and $150, and no discount if it's below $75. Store the discounted amounts in a new array.