Write a ruby program that reads a line from the user

Assignment Help Computer Engineering
Reference no: EM13332012

• Lecture 13 (02/26)

? In class assignments #12. Design a Ruby class that inherits from the inbuilt String class and adds an additional functionality to check if the string is a palindrome. Email your code by end of day 02/28.

• Lecture 12 (02/21)

? In class assignments #11. Design a Ruby class to process weather data from NCDC as discussed in class. You should be able to set a particular year and find the maximum temperature in that year. Email your code by end of day 02/26.

• Lecture 11 (02/19)

? In class assignments #10. Design a Ruby class to set and get a single line of text, check for substring, get the length and concatenate with another input string. Email your code by end of day 02/21.

• Lecture 10 (02/14)

? In class assignments #9. Each file in the folder 1951 is associated with a particular weather station. For example, the file 010230-99999-1951 contains recordings (multiple recordings per day) from the weather station id 010230 for the whole year of 1951. Similarly other files for other weather stations. Write a Ruby program that merges all the files in the folder into a single new file called "1951-recordings". You can place all the records from a particular weather station followed by all the records of another station and so on. Then compute the average global temperature for the year 1951. (Remember that the measurements were made at multiple times per day!) Use your regular team for this assignment. Submit your code by end of day 02/19 by email.

• Lecture 9 (02/12)

? In class assignments #7 and #8. Assignment #7: Complete previous assignment without number of players assumed ahead of time. Assignment #8: Compute the highest temperature in the years 1901 and 1902. (The data is here. Format information is available here.) Email your code for the two assignments (separately) by end of day 02/14.

• Lecture 8 (02/07)

? In class assignment #6. Build on the previous assignment to write a function to compute a tournament winner with 2^n number of players.

• Lecture 7 (02/05)

? In class assignment #5. Write a Ruby function that takes as input an array modeling a simple rock-paper-scissors game and returns the winning's players name. For example, if the input to the function is the array [["Alice", "Rock"], ["Bob", "Paper"]], the function should return the string "Paper". Name your file <lastName>.rb and email your code by identifying your team members by end of day 02/06.

• Lecture 6 (01/31)
? In class assignment #4. Write a Ruby function that takes as input an array of strings, groups them into anagrams and returns an array of anagram arrays. For example, if the input to your function is ["god", "dog", "no", "on", "google", "yahoo"] then the return value should be [["god", "dog"], ["no", "on"], ["google"], ["yahoo"]]. Write a Ruby program to demonstrate that the function works. Name your file as<lastName>.rb and email by end of day 02/01.

• Topics covered: Array operations in Ruby.
• Lecture 5 (01/29).
? Assignment #3. Write a Ruby program that reads a line from the user and checks if the line is a palindrome. You should ignore case and punctuation characters in deciding if the input is a palindrome. For example, "A man, a plan, a canal - Panama" is a palindrome. See other examples here. Assignment #2 posted. (See lecture 4 below.)

Topics covered: intro to Ruby: programming exercise.

Reference no: EM13332012

Questions Cloud

What is the pans distance from the ceiling : A massless pan hangs from a spring that is suspended from the ceiling. What is the pan's distance from the ceiling when the spring reaches its maximum length
What steps are required to convert sampson pty ltd : Discuss the implications if the directors of Sampson Pty Ltd sign a contract to develop commercial properties and advise Sam of any liability arising from his sale of the business to the company.
Evaluate the shortest period of rotation : The fastest possible rate of rotation of a planet is that for which the gravitational force on material at the equator barely provides the centripetal force needed for the rotation. evaluate the shortest period of rotation
What is the new water level and motion commented : A graduated cylinder contains 155 mL of water . A 15.0-g piece of iron (density = 7.86g/cm^3) and a 20.0-g piece of lead (density = 11.3 g/cm^3) are added. What is the new water level, in milliliters, in the cylinder? motion commented
Write a ruby program that reads a line from the user : In class assignments #12. Design a Ruby class that inherits from the inbuilt String class and adds an additional functionality to check if the string is a palindrome. Email your code by end of day 02/28.
What is the induced emf in one of the windings : A solenoid of length 4.5 cm and diameter 0.85 cm is wound with 181 turns per cm. The current is decreasing at a rate of 36.6 A/s. What is the induced emf in one of the windings
How much current is flowing through the wire : The magnitude of a magnetic field a distance 0.0001 m from a wire is 11.0*10^4 T. How much current is flowing through the wire
Find the cars rotational energy : A car with a total mass of 1.43 103 kg has wheels of radius 29.0 cm and moment of inertia 0.885 kg · m2. Find the car's rotational energy when the car is moving at a speed of 22.0 m/s
Calculate the case mix index for the hospitals : Calculate the case mix index for the hospitals, which use the same patient classification system and create a benchmark for future years and to be able to compare performance to similar peer practices

Reviews

Write a Review

Computer Engineering Questions & Answers

  Verilog system

Develop a Verilog system which will accept a block of data words; then check the parity for each data word and for the block.

  Write a recursive process called productarray

Write a recursive method called productArray that takes an array of integers, a start index and an end index and returns the product of elements of the array.

  Windows live id and skydrive account

Suppose there are 1 million books within your campus library. Approximate (to the nearest order of magnitude) how several bytes of the data there are in case all these books were stored online and accessible across the computer network.

  Plan a decision tree for this situation

Premium Airlines has recently offered to settle claims for a class-action suit that was originated for alleged price fixing of tickets. The proposed settlement is stated as follows. Draw a decision tree for this situation.

  Describe uses for each of intellectual property protection

Give two examples of how a social pressure or need led to the development of a new information technology. Give two examples of how the adoption of a new information technology changed society.

  Specify modifications that implemented to it infrastructure

Identify any modifications that should be implemented to the IT infrastructure in order to accommodate the requirements of the EHR.

  Assume 3 values (x, y, and z) are stored in machine''s memory

Suppose three values (x, y, and z) are stored in a machine's memory. explain the sequence of events (loading registers from memory, saving values in memory, and so on) that lead to the computation of x + y + z. How about (2x) + y?

  Amazon kindle changed the number of print books

Has popularity of the Amazon Kindle changed number of print books Kindle users buy.

  How to develop a simple scientific calculator

make a Clear button to clear the result text box and reset all controls.

  Write down the names of five currencies

Write down a C program that displays a title, "Currency Conversion," and then write the names of five currencies and their equivalents to the US dollar. The conversions are hard coded equations.

  Evalute the buying price and the current price of each stock

After the table is displayed, print out the stock with the highest profit if sold and its position in the array[row][column].evalute the buying price and the current price of each stock.

  Checksum of tcp and udp

UDP and TCP utilize the 1s complement their checksums. Assume that you have following three 8-bit bytes: 01010011, 01010100, and 01110100.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd