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

  Recursive method to search a string for a byrd

Write a recursive method that searches a string for a Byrd. A Byrd has the following properties. Its first character is an 'A'. If it is a two character Byrd then its second and last character is an 'H'.

  Object-oriented analysis and design

Object-Oriented Analysis and Design,  PART B-object-oriented design involves the steps 13-18:

  Create a multi-threaded competition

Create a multi-threaded competition

  Program for saving account balance report

Savings account balance report from customer savings account file. Every input savings account record contains account number, balance forward, deposits (sum of all deposits).

  Discussion: html/css

Discussion: HTML/CSS,  "JavaScript Placement"  Please respond to the following: Compare and contrast the process of adding JavaScript and a Cascading Style Sheet to a Website. Determine if they can be used simultaneously in a page. If so, explain wh..

  Computer sales and repair store system

It is required to design a relational database system for a "realistic" application

  Creating personnel promotion application program

The following application program will be modified to accommodate the change to the database table. The personnel promotion application program.

  Wilkerson-irwin algorithm to minimize mean tardiness

Write a program to implement the Wilkerson-Irwin algorithm to minimize mean tardiness.

  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.

  Implementing class called card for standard playing card

Design and implement a aclass called Card that represents a standard playing card. each card has a suit and a face value.

  Write a program that uses the curve class hierarchy

Write a program that uses the curve class hierarchy. The program should define several different objects, output their area, circumference, etc. It should also use the printcurve function.

  Write pseudocode

Write pseudocode that represents the abstract functions of the enqueue and dequeue operations. Define and explain any supplementary information needed by your pseudocode.

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