I need help with Python. Please follow all the instructions. Program Requirements Some whole numbers can be
Fantastic news! We've Found the answer you've been seeking!
Question:
I need help with Python. Please follow all the instructions.
Transcribed Image Text:
Program Requirements Some whole numbers can be split into smaller pieces, where each piece contains the same number of digits. For a subset of the whole numbers which can be split evenly, the pieces are in numerically increasing order. Examples: 154152 can be split evenly into two-digit pieces (15, 41, 52) - increasing order 154152 can be split evenly into three-digit pieces (154, 152) - not increasing order 154152 cannot be split evenly into five-digit pieces 173 can be split evenly into one-digit pieces (1, 7, 3)- not increasing order 173 can be split evenly into three-digit pieces (173) - increasing order 173 cannot be split evenly into two-digit pieces Design, implement and test a Python program that checks to see if a user-supplied whole number can be split evenly into pieces that are in numerically increasing order. 1. The program will prompt the user to enter a whole number. If the user enters an invalid input (anything other than a whole number), the program will repeatedly prompt the user until a valid input is entered. 2. The program will then prompt the user to enter the number of digits in each piece. The program will verify that the input is valid (a whole number which is a proper divisor of the number of digits in the first input); if the input is invalid, the program will repeatedly prompt the user until a valid input is entered. 3. The program will split the number into pieces and display those pieces on one line (separated by commas). 4. The program will report whether or not the pieces are in numerically increasing order. If there is only one piece, it is defined to be in numerically increasing order. 5. The program will keep track of "scores", i.e., the number of times that the pieces are in numerically increasing order or decreasing order. Once the score reaches 5 numerically increasing sequences, the "game" tells the user that they won and ends. 6. Add one other "Fun" feature to the game. This is intentionally broad - so if you're more comfortable with programming, you could add something fun and creative here. If you're newer to programming, it could be more simple like another "score" variable you track for "losing" the game after 5 decreasing sequences. Be creative! Program Requirements Some whole numbers can be split into smaller pieces, where each piece contains the same number of digits. For a subset of the whole numbers which can be split evenly, the pieces are in numerically increasing order. Examples: 154152 can be split evenly into two-digit pieces (15, 41, 52) - increasing order 154152 can be split evenly into three-digit pieces (154, 152) - not increasing order 154152 cannot be split evenly into five-digit pieces 173 can be split evenly into one-digit pieces (1, 7, 3)- not increasing order 173 can be split evenly into three-digit pieces (173) - increasing order 173 cannot be split evenly into two-digit pieces Design, implement and test a Python program that checks to see if a user-supplied whole number can be split evenly into pieces that are in numerically increasing order. 1. The program will prompt the user to enter a whole number. If the user enters an invalid input (anything other than a whole number), the program will repeatedly prompt the user until a valid input is entered. 2. The program will then prompt the user to enter the number of digits in each piece. The program will verify that the input is valid (a whole number which is a proper divisor of the number of digits in the first input); if the input is invalid, the program will repeatedly prompt the user until a valid input is entered. 3. The program will split the number into pieces and display those pieces on one line (separated by commas). 4. The program will report whether or not the pieces are in numerically increasing order. If there is only one piece, it is defined to be in numerically increasing order. 5. The program will keep track of "scores", i.e., the number of times that the pieces are in numerically increasing order or decreasing order. Once the score reaches 5 numerically increasing sequences, the "game" tells the user that they won and ends. 6. Add one other "Fun" feature to the game. This is intentionally broad - so if you're more comfortable with programming, you could add something fun and creative here. If you're newer to programming, it could be more simple like another "score" variable you track for "losing" the game after 5 decreasing sequences. Be creative!
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
see below questions and provide me adjusted coding by using my coding. I share my coding and test failure message at the end. 1. BST.java 2.BSTNode.java Binary Search Tree you will be coding the...
-
The new line character is utilized solely as the last person in each message. On association with the server, a client can possibly (I) question the situation with a client by sending the client's...
-
Duhail Complex averages about 15% of Bananas spoil before they can be sold. The manager purchases 200kg of bananas for 2.03QR per kilogram. What is the selling price if there is a 45% markup on the...
-
On May 2, 2019, HPF Vacations received its April bank statement from First City Bank and Trust. Enclosed with the bank statement, which appears below, was a debit memorandum for $160 that covered an...
-
A student drops a small black sphere alongside a vertical scale marked in centimetres. A number of flash photographs of the sphere are taken at 0.10 s intervals: The first photograph is taken with...
-
A new induction motor is put into operation. The initial vibration is acceptable, but after 1 hour of loaded operation, the 1 vibration has increased to an unacceptable level. The motor is...
-
Joes is a small ice-cream shop located near the local universitys baseball field. Joes serves walk-in customers only. The shop carries 26 flavors of ice cream. Customers can buy cones, sundaes, or...
-
Manufacturing overhead for the year was estimated to be $1,013,600 while the actual manufacturing overhead for the year was $955,000. Actual machine-hours for the year were 36,380 hours, and...
-
Rio Ferinand, the owner of Ferdinand Gold Mining, is evaluating a new gold mine in Fort McMurray. Paul Pogba, the company's geologist, has just finished his analysis of the mine site. He has...
-
9. Calculating Instantaneous and Average Velocities Consider the following position-time graph of an object moving along a straight-line. 10 Position (cm) 8 6 4 2 A B 1 2 C 3 Time (s) D 4 5 6
-
Suppose the National League team has a probability of \(\frac{3}{5}\) of winning a World Series game and the American League team has a probability of \(\frac{2}{5}\). The series is over as soon as...
-
Fill in the blank field in this text: While in the Door tool you can change the door style and size via the [1]_________________________________within the Properties Palette.
-
Fill in the blank field in this text: Clicking on the[1]_________________________ next to the Zoom icon will list additional zoom tools not currently shown in the View toolbar.
-
Revit comes with many predefined doors and windows. A) True B) False
-
Fill in the blank field in this text: The icon with the floppy disk picture allows you to [1]__________ a project file.
-
An aluminum pan whose thermal conductivity is 237 W/mC has a flat bottom whose diameter is 27 cm and thickness 0.64 cm. Heat is transferred steadily to boiling water in the pan through its bottom at...
-
9.Consider the reaction 3NO2(g)+H2O=2HNO3(aq)+NO(g) where Delta H=-137 kJ.How many kilojoules are released when 92.3g of NO2 reacts?
-
The following additional information is available for the Dr. Ivan and Irene Incisor family. The Incisors own a rental beach house in Hawaii. The beach house was rented for the full year during 2012...
-
Charlie's Green Lawn Care is a cash basis taxpayer. Charlie Adame, the sole proprietor, is considering delaying some of his December 2012 customer billings for lawn care into the next year. In...
-
Sophie is a single taxpayer. For the first payroll period in October 2012, she is paid wages of $3,250 monthly. Sophie claims three allowances on her Form W-4. a. Use the percentage method to...
-
Victoria has prepared the following list of statements about corporations. 1. A corporation is an entity separate and distinct from its owners. 2. As a legal entity, a corporation has most of the...
-
Indicate whether the following items would appear on the income statement (IS), statement of financial position (SFP), or retained earnings statement (RES). a. Dividends. b. Cash. c. Salaries and...
-
On May 10, Chen Co. issues 2,000 6 par value ordinary shares for cash at 13 per share. Journalize the issuance of the shares.
Study smarter with the SolutionInn App