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

  What is java adapter class

What is Java adapter class.

  Explaining risk in fixed-price contracts

It is recognized that fixed-price contracts offer obvious advantages to buyer organizations because they transfer almost all of the risk to the contractor.

  Write a program using binary search approach

Write a program using binary search approach

  Writing a class

Build a class for a type called Fraction

  Explaining variable in an arrays of ints

Assume that variable A is an arrays of ints. Consider the following code segment.

  Php code to add-delete product using ajax programming

PHP Code to add a new product and delete a existing product Implement AJAX Programming based solutions to write code to add a new product to the database.

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Code to sum of all the elements of the array

Write some code that places the sum of all the elements of the array x into total. Declare any variables that you need.

  Program to fill 0s and 1s into tictactoe board

Write a program which randomly fills in 0s and 1s into TicTacToe board, prints board.

  Program-customer-s names phone numbers in alphabetical order

Load file into parallel arrays and display list of customers' names and phone numbers in alphabetical order.

  Using the irvine32 library functions

Create 32 random points which have (x, y) co-ordinates

  Executive committee for alleviating it complexity

You are a consultant brought in by the executive committee to make recommendations for alleviating the "IT complexity" concerns of the executives at the company.

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