Question: Figurel shows a sample run of the program with valid numbers and Default representation format type. Figure2 shows a sample run of the program with

 Figurel shows a sample run of the program with valid numbersand Default representation format type. Figure2 shows a sample run of the

Figurel shows a sample run of the program with valid numbers and Default representation format type. Figure2 shows a sample run of the program with valid numbers and Scientific representation format type. Figure3 shows a sample run of the program with valid numbers and Non Scientific representation format type. Figure4 shows a sample run of an invalid format type and Figure5 shows a sample run of the program with invalid numbers. Console 1/4 B Please enter 5 integer numbers greater than 10: 11 12 13 14 15 Thanks for entering 5 valid numbers greater than 10 Please enter the format type: D Defalut representation S Scientific representation and default precision N Non Scientific representation and 2 decimal precision Console 1/1 Please enter 5 integer numbers greater than 10: 11 12 13 14 15 Thanks for entering 5 valid numbers greater than 10 Please enter the format type: D Defalut representation Scientific representation and default precision N Non Scientific representation and 2 decimal precision S 5 Output format: Output format: Default representation Scientific representation Precision-default: Sterling Value 11 12 13 14 15 Sterling Value 39615625 475687486 6187239475 86661001740 1388430722199 11 12 13 3.961563e07 4.756875e-08 6.187239e-09 8.666100e+10 1.390431e+12 In (24) In [2): Figurel: Sample run of the program with valid numbers and Default representation format type. Figure2: Sample run of the program with valid numbers and Scientific representation format type. Console 1/B Consele 1/4 B Please enter 5 integer numbers greater than 10: 11 12 13 14 15 Thanks for entering 5 valid numbers greater than 19 Please enter the format type: D Defalut representation Scientific representation and default precision N Non Scientific representation and 2 decimal precision S In [21]: runfile("C:/zuhoor_Hard disk/Zuhoor 2020/COMP2101/Python COMP2101_Spring2021/Hws/12/12 Sample Solution SP2021_zuhoor.py', wdir='C:/ zuhoor_Hard disk/Zuhoor 2828/COMP2161/Python COP2101_Spring2021/Has/H12") Please enter 5 integer numbers greater than 10: 11 12 13 14 15 Thanks for entering 5 valid numbers greater than 10 Output format: Mon-Scientific representation Precision = 2: Sterling Value Please Enter the format type: D Defalut representation 5 Scientific representation and default precision N Non Scientific representation and 2 decinal precision 39615625.85 475687496.47 6187239475.19 86661001749.60 1308430722199.47 kg You entered an invalid format type 12 13 14 15 In [22] **TER PTUDIO The factorial of a number n (written n!) is the number times the factorial of itself minus one; and the factorial of 1 is, by definition, equals to 1. For example, the factorial of 2 is 2*1!= 2*1, and the factorial of 3 is 3*2!= 3*2*1 = 6, and so on. Implementing this definition using a computer program is relatively slow, instead Sterling's formula is used as an approximation of the factorial for large values. Sterling's formula is defined as follows: n! = e-nn" V2 In The exp(x) function in the math module gives the value of e raised to the power of x Write a Python program that: 1. Requests the user to enter 5 integer values of n greater than 10. It should check: a. if all entered values are greater than 10, then your program should: output the message: Thanks for entering 5 valid numbers greater than 10" calculate their factorial using sterling's formula allow the users to enter one of the following format types, which should be used to print the factorials of the numbers D Default representation S Scientific representation with default precision N Non Scientific representation with 2 decimal precisions validate the format type: if the format type is Default representation, then it should display the results in a tabular format using "Default representation" as shown in Figurel. else if the format type is Scientific representation with default precision, then it should display the results in a tabular format using Scientific representation with default precision" as shown in Figure2. else if the format type is "Non Scientific representation, then it should display the results in a tabular format using Non Scientific representation with 2 decimal precisions as shown in Figure3. otherwise, your program should display the following message as shown in Figure4: "You entered an invalid format type" b. otherwise, your program should output the following message: "Sorry you entered wrong numbers BYE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!