Lab Topic 6 individual F23

.docx

School

Texas A&M University *

*We aren’t endorsed by this school

Course

102

Subject

Computer Science

Date

Jan 9, 2024

Type

docx

Pages

1

Uploaded by ProfLightning103643

Report
Lab: Topic 6 (individual) ENGR 102 Lab: Topic 6 (individual) Deliverables: There are two deliverables for this individual assignment. Please submit these files to zyBooks: howdy_whoop.py juggler_sequence.py Activity #1 : Howdy Whoop – individual Write a program named howdy_whoop.py that takes as input from the user two positive integers. Output the numbers 1 to 100, each on its own line, unless the number is evenly divisible by one or both of the integers entered by the user. If the number is evenly divisible by the first integer, print Howdy . If it’s evenly divisible by the second integer, print Whoop . If it’s evenly divisible by both, print Howdy Whoop . Format your output as shown below. User input is shown in bold and red text. Example output (using inputs 2 and 3 ): Enter an integer: 2 Enter another integer: 3 1 Howdy Whoop ... Whoop Howdy Activity #2 : Juggler sequence – individual The Juggler sequence ( https://en.wikipedia.org/wiki/Juggler_sequence ) produces a sequence of integers using the following procedure. Given a number n , if n is even then the next number is the floor of the square root of n . If n is odd, then the next number is the floor of n 3 / 2 . The Juggler sequence ends when n reaches 1. As an example, if you start with the number 7, then the terms of the sequence will be: 7, 18, 4, 2, 1. Write a program named juggler_sequence.py that takes in a positive integer from the user, and computes the Juggler sequence, printing out all the numbers in the sequence, followed by a line stating how many iterations it took to reach the value 1. Format your output as shown below. User input is shown in bold and red text. Example output (using input 7 ): Enter a positive integer: 7 The Juggler sequence starting at 7 is: 7, 18, 4, 2, 1 It took 4 iterations to reach 1 Based upon Dr. Keyser’s Original 1 Revised Fall 2023 SNR
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help