logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Luis RiveraFinance
(5/5)

750 Answers

Hire Me
expert
Soni GiranComputer science
(5/5)

569 Answers

Hire Me
expert
Neill BissonnetteData mining
(5/5)

863 Answers

Hire Me
expert
Deepak BansalAccounting
(5/5)

704 Answers

Hire Me
Python Programming
(5/5)

Write a program that allows the user to enter a number between 1 and 1000. If the number is invalid, provide an error message and allow the user

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Computer Programming Python

Assignment: Facts with Loops

Basic Program: Number Facts

Worth 50 points

This lab requires you to think about the steps that take place in a program by writing algorithms. This lab one of the following:

• High-level IPO Chart and pseudocode

• Hierarchy chart and pseudocode

• Hierarchy chart and detailed IPO Chart

Program Summary:

Write a program that allows the user to enter a number between 1 and 1000. If the number is invalid, provide an error message and allow the user to try again until he enters a valid value.

Once you have a valid number, use it to determine and print the following information:

· Number squared: 36

· Number cubed: 216

· List of factor pairs:

o (1, 6)

o (2, 3)

o (6, 1)

· Number Type: Odd or Even Prime (Exactly 2 factors) or Composite (More than 2 factors)

Technical Requirements:

• Include the program name, student heading and summary in comments at the beginning of your program

• Include comments throughout your program to explain logic

• Use a condition while loop that will cause the loop to execute if the number entered is not valid. The loop should provide feedback indicating that the number entered was invalid, and provide the user the opportunity to enter a different one.

• Use a counter loop of your choice to determine list of factors

• When determining the number characteristics, do not use any python mathematical functions like sqrt

• Match the sample output as closely as possible

Sample Test Data:

Please enter a positive integer less than 1,000: 12

Number Facts about 12:

Squared Value: 144

Cubed Value: 1,728

Factors: (1, 12)

(2, 6)

(3, 4)

(4, 3)

(6, 2)

(12, 1)

Type: Even composite number

Moderate Program: Number Facts

Worth 65 points

Program Summary: Write a program that allows the user to enter a number between 1 and 999. If the number is invalid, provide an error message and allow the user to try again until he enters a valid value.

Once you have a valid number, use it to determine and print the following information:

Number is 6

Number squared: 36

· Number cubed: 216

· List of factor pairs:

o (1, 6)

o (2, 3)

o (6, 1)

· Number Type: Even composite number

Odd or Even Prime (Exactly 2 factors) or Composite (More than 2 factors)

· Whether the number is a perfect square: No (6 does not have an integer square root like 4 or 9)

· Square Root: (Print this line only if the number is a perfect square)

Technical Requirements:

• Include the program name, student heading, and summary in comments at the beginning of your program

• Include comments throughout your program to explain the logic

• Use a condition while loop that will cause the loop to execute if the number entered is not valid. The loop should provide feedback indicating that the number entered was invalid, and provide the user the opportunity to enter a different one.

• Use a counter loop of your choice to determine the list of factors

• When determining the number characteristics, do not use any python mathematical functions like sqrt

• Match the sample output as closely as possible

Test Data:

Sample Output:

Please enter a positive integer: 12

Number Facts about 12:

Squared Value: 144

Cubed Value: 1,728

Factors: (1, 12)

(2, 6)

(3, 4)

(4, 3)

(6, 2)

(12, 1)

Type: Even composite number

Perfect Square: No

Please enter a positive integer: 9

Number Facts about 9:

Squared Value: 81

Cubed Value: 729

Factors:

(1, 9)

(3, 3)

(9, 1)

Type: Odd composite number

Perfect Square: Yes

Square Root: 3

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme