Ruby program that continuously reads in number

Assignment Help Programming Languages
Reference no: EM1347119

Q1) Write down Ruby program that continuously reads in number, x, from screen, and then calculates and displays its:

i) factorial, if x is less than 15;
ii) fourth power, if 15 < x ≤ 35 and
iii) square, if x > 35.

Your program should run until the user wishes to stop running it. In other words, after processing the first number, it should ask the user if he or she wants to continue. If the answer is no the program terminates; if the answer is yes it reads in another number, processes it and asks the user again until the user says no.

Reference no: EM1347119

Questions Cloud

Explain how will the economy change over time : Explain how will the economy change over time. Explain in words and using an aggregate-demand/aggregate-supply diagram.
Theoretical frameworks : Theoretical Frameworks - Dissertation about Employee Retention; why do employees leave their companies and how can management retain employees
Variable costing-financial reporting : Why is variable costing not allowed for financial reporting purposes?
Solving financial analysis problem : Acme producing is a decentralized company. Sections are treated as investment centers. In recent years, Acme has been running about 11 percent ROA for company as a whole, and has a cost of capital of 9%.
Ruby program that continuously reads in number : Write down Ruby program that continuously reads in number, x, from screen, and then calculates and displays its: factorial, if x is less than 15.
Describe how the concepts from lockes goal : Describe how the concepts from Locke's goal setting theory can be incorporated into Vroom's expectancy theory. Explain how the concepts in Adams' equity theory can be incorporated into expectancy theory.
Illustrate what is the effect on equilibrium price : Illustrate what is the effect on equilibrium price and quantity in the market for oranges if a new orange picking machine is developed.
Stanley works costing system : Stanley Works is one of the companies you looked at in the job-order costing vs. process costing. Which type of costing do you think that company uses, process costing or job-order costing?
Jamestown textiles process costing : Calculate the total work done in equivalent units and the unit cost for April. Calculate the cost of units completed and transferred. Also, compute the costs in ending work in process.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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