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

  How it influence it department''s ability to maintain

be sure to address readability as a characteristic and how it will influence an IT department's ability to maintain custom software for a corporation.

  Which is true of today''s cios

The traditional set of IS responsibilities includes all of the following except.

  Discuss on business performance management

define how Knowledge Management benefits organizations.

  Write a program to simulate the authentication process

The user would enter 23113 instead of 12345. This doesn't divulge the password even if an attacker intercepts the entry because 23113 could correspond to other PIN numbers.

  Plan sequence using d flip flops

plan a circuit that would count in the following sequence using D Flip Flops

  Creating database for company

If you were preparing to create a brand new database for a company, do you think there would be any value in the interviewing the users to determine out what colors and designs they like?

  Write down a unix shell script

For an example, if I want to search for a text file/script that contains the most number of for loop statements, and have it displayed on the screen, How will I do that?

  Describing the lcg

Provide the value of a? Specify the restrictions that are required on the seed?

  Why grades averaged and sorted from highest to lowest

The names need to be sorted alphabetically why grades averaged and sorted from highest to lowest.

  What is best-case complexity of the algorithm

What is best-case complexity of the algorithm?

  Determining the companys checkbook or ledger

The subcontractor says that original check was for only $10,750. Jonathan looks around office however was not able to determine the company checkbook or ledger.

  Implementing the program

Write down the program which will enable a teacher to calculate the percentage and the final grade for the students in a class.

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