Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you how to input this? using Python, here is an example of input and output: Some whole numbers can be split into smaller pieces,

image text in transcribed

Can you how to input this? using Python, here is an example of input and output:

image text in transcribed

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). 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. Assignment Deliverables The deliverable for this assignment is the source code for your Python program. Input a large whole number: 123456 Input the split (whole number): 2 12, 34, 56 Sequence is increasing RESTART Input a large whole number: 121289 Input the split (whole number): 2 12, 12, 89 Sequence is not increasing == RESTART Input a large whole number: 123456 Input the split (whole number): 3 123, 456 Sequence is increasing RESTART Input a large whole number: 123456 Input the split (whole number): 6 123456 Sequence is increasing RESTART Input a large whole number: abcd Input must be a whole number. Try again. Input a large whole number: -34 Input must be a whole number. Try again. Input a large whole number: 123456 Input the split (whole number): xyz Input must be a whole number. Try again. Input the split (whole number): -5 Input must be a whole number. Try again. Input the split (whole number): 5 123456 must be evenly divisible by 5 Try again. Input the split (whole number): xy Input must be a whole number. Try again. Input the split (whole number): -2 Input must be a whole number. Try again. Input the split (whole number): 2 12, 34, 56 Sequence is increasing

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

What is meant by decentralisation of authority ?

Answered: 1 week ago

Question

Briefly explain the qualities of an able supervisor

Answered: 1 week ago

Question

Define policy making?

Answered: 1 week ago

Question

Define co-ordination?

Answered: 1 week ago

Question

What are the role of supervisors ?

Answered: 1 week ago

Question

4. Who would lead the group?

Answered: 1 week ago

Question

Where those not participating, encouraged to participate?

Answered: 1 week ago