Program to print chains of numbers within a range

Assignment Help Programming Languages
Reference no: EM1345652

Q1) Write a program to print the chains for the numbers within a range that the user specifies. The length of each chain should be printed at the end of the chain.

First, write a function hailstone() that contains a while loop that prints out a single chain and keeps track of how long it is. Each step of the while should move the current value to the next step.

Then, imbed a call to your hailstone function inside a for loop to print the chains from 10 to 20. Remember to use range.

Reference no: EM1345652

Questions Cloud

Determine the amount of additional financing required : Jones Corporation sales last year were $25 million and its total assets were 8 milliondollar. Accounts payable were $2 million & common stock & retained earnings were 5 million dollar.
Compute the magnitude of the friction force : An 75.0 spacewalking astronaut pushes off a 640 satellite, exerting a 80.0 force for the 0.440 it takes him to straighten his arms. How far apart are the astronaut and the satellite after 1.5 min.
Explain conflict in project management : Explain conflict in project management and how to manage constant stress - explain how conflict is synonymous with project management.
What is the slit width of the wavelength : A professor walks in a long hall carrying a vibrating 512Hz tuning fork. The end of the hall is closed so that sound reflects from it. The student hears 4 beats per second. How fast is the student walking and in what direction.
Program to print chains of numbers within a range : Write a program to print the chains for the numbers within a range that the user specifies.
Find the larger potential percent loss : Suppose you wants to control price movements of 100 shares of stock. You may buy 100 shares of stock directly or purchase a call option on 100 shares.
Prevailing prices-changing in same direction : Does it appear that futures prices among currencies (for the closest settlement date) are changing in the same direction? Explain.
Review the discussion of corporate culture : Can you use CAD, CAE, CAM, CIM, and FMS to manufacture better parts more easily - company's culture by observing the layout and design of its production facility?
Find the final temperature of the water in the cavity : A tennis racket has nylon strings. If one of the strings with a diameter of 1 mm is under the tension of 15 N, how much is it lengthened from its original lenght of 40 cm.

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