Include: Main loop that asks for any string Handling of all possilbe exit commands Checking of symmetrical
Fantastic news! We've Found the answer you've been seeking!
Question:
Include:
Main loop that asks for any string
Handling of all possilbe exit commands
Checking of symmetrical string and printing message
Printing of message with string lenght and string in reverse
Testing: You have tested your program for atleast one set of values
Comments: Add necessary comments to explain the process
Transcribed Image Text:
Demonstrate a flow chart and display a program in Python that calculates the value of ffrom the following equations. Prompt the user to enter values for a, b0, d, and n. Add appropriate checks to make sure that all of them are positive integers. Please note that is a summation symbol, which can be implemented using loops. The loop limits are given as i=1 to i=n. Also, note that bi-1 is not a separate variable. It is the value of same b variable from the last iteration of the loop. For example, if user enters the value for 60 to be 5, then for i=1: 6b1 = 61 -1 +3 and b1-1 = b0 so b1 = 5+3=8 Draw the flow chart first and then implement your flow chart in Python. Include: A flow chart that shows the complete process to solve this problem User Input and Validation (if the input is not a correct print descriptive error) Code to calculate bi Summation Implementation and display the output Testing: You have tested your program for at least one set of values Comments: Add necessary comments to explain the process Question 2: Demonstrate a program in which you ask user to enter a string in a loop. If user enters 'Exit' then you print an "Exiting, good by" message and finish the execution of program. If user enters a symmetrical string then your print the message "Its a Palindrome!" and then programe continues for next input. If user enters any other string you print the length of the string and the string in reverse order and then program continues to ask user for a new string. Please note the following: A string is symmetrical if string is equal to its reverse string (eg: ama, abba, ambma, etc (there are infintly many such strings)). Your prorgam should exit when user enters word exit with any combination of Upper and Lower case letters (eg: Exit, exit exit, exIT etc are all valid exit commands) Exiting the program means terminating the execution. This can be implemented using break statement in the loop. please do not use exit() function in jupyter becasue it kills the kernel. Demonstrate a flow chart and display a program in Python that calculates the value of ffrom the following equations. Prompt the user to enter values for a, b0, d, and n. Add appropriate checks to make sure that all of them are positive integers. Please note that is a summation symbol, which can be implemented using loops. The loop limits are given as i=1 to i=n. Also, note that bi-1 is not a separate variable. It is the value of same b variable from the last iteration of the loop. For example, if user enters the value for 60 to be 5, then for i=1: 6b1 = 61 -1 +3 and b1-1 = b0 so b1 = 5+3=8 Draw the flow chart first and then implement your flow chart in Python. Include: A flow chart that shows the complete process to solve this problem User Input and Validation (if the input is not a correct print descriptive error) Code to calculate bi Summation Implementation and display the output Testing: You have tested your program for at least one set of values Comments: Add necessary comments to explain the process Question 2: Demonstrate a program in which you ask user to enter a string in a loop. If user enters 'Exit' then you print an "Exiting, good by" message and finish the execution of program. If user enters a symmetrical string then your print the message "Its a Palindrome!" and then programe continues for next input. If user enters any other string you print the length of the string and the string in reverse order and then program continues to ask user for a new string. Please note the following: A string is symmetrical if string is equal to its reverse string (eg: ama, abba, ambma, etc (there are infintly many such strings)). Your prorgam should exit when user enters word exit with any combination of Upper and Lower case letters (eg: Exit, exit exit, exIT etc are all valid exit commands) Exiting the program means terminating the execution. This can be implemented using break statement in the loop. please do not use exit() function in jupyter becasue it kills the kernel.
Expert Answer:
Answer rating: 100% (QA)
Question 1 Flowchart Start Input values for a b d and n Check if all inputs are positive i... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Gene's Incremental Revenue Worksheet Unit Additional Number Revenue Product Costs Other Variable Contribution to 1 $850 $255 Costs $382.50 Fixed Costs $213 2 $700 3 $650 4 $750 5 $900 Total $3,850 A....
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
a. Show that if the position x of a moving point is given by a quadratic function of t, x = At 2 + Bt + C, then the average velocity over any time interval [t 1 , t 2 ] is equal to the instantaneous...
-
For the angle cross section indicated, determine the orientation of the principal axes at the origin and the corresponding values of the moments of inertia. The L5 3 1/2 -in. angle cross section of...
-
A jet transport plane flies in the trajectory shown in order to allow astronauts to experience the weightless condition similar to that aboard orbiting spacecraft. If the speed at the highest point...
-
Consider the simple linear regression model fit to the toluene-tetralin viscosity data in Problem 2.15. Problem 2.15 Byers and Williams ("Viscosities of Binary and Ternary Mixtures of Polynomatic...
-
The questions in this exercise give you an appreciation for the complexity of budgeting in a large multinational corporation. To answer the questions, you will need to download the Procter & Gamble...
-
The following problems all concern an input array of integers, possibly with duplicate entries. Which of them can be solved using a single invocation of a sorting subroutine followed by a single pass...
-
Goldie and Kurt want advice from your financial advising firm. They have provided the following information. They graduated from university four years ago and they have good jobs, but neither of them...
-
RyanAir is a discount airline that flies Boeing 737s popular routes throughout Europe. In order to maintain profitability they attempt to fly their planes at capacity but they do allow customers to...
-
How are financial projections tailored to specific stakeholders and decision-making contexts, incorporating sophisticated sensitivity analyses and risk-adjusted metrics to inform strategic planning...
-
5.Consider a Blazer that is advertised at a monthly payment of $1714 for 5 year with 8.88%. What is the APR (to the nearest tenth of a percent)? 7.You want to purchase a computer that has a price of...
-
A Bank currently offers traditional banking services, from which they generate an average return of 8% while bearing a risk () of 2%. They are planning to allocate 45% of their activity to...
-
8.Home Depot offers an installment loan at 4.39% (add-on rate) if you buy a refrigerator. If the refrigerator at Home Depot costs $2377 and you want to pay for the refrigerator for 4 years, what is...
-
Discuss the overall impact of the recent Federal Reserve interest rate hikes on capital structure and capital budgeting within small, medium, and large businesses. (hint: This discussion should...
-
Producing a soccer ball costs Jake $5. He sells it to Darby for $35. Darby values the soccer ball at $50. For this transaction, the total surplus in the market is $40 True False
-
The Adjusted Trial Balance columns of a 10-column work sheet for Webber Co. follow. Complete the work sheet by extending the account balances into the appropriate financial statement columns and by...
-
Write a program to simulate the sending-site FSMs for the simple protocol (Figure 23.18). Figure 23.18 FSMS for the simple protocol Request came from application. Packet arrived. Make a packet and...
-
A substitution cipher does not have to be a character-to-character transformation. In a Polybius cipher, each letter in the plaintext is encrypted as two integers. The key is a 5 Ã 5 matrix of...
-
In classless addressing, can two different blocks have the same prefix length? Explain.
-
Companies are facing a great amount of change in every facet of their operations today. To remain competitive, companies must keep abreast of current developments in several areas. You recently got...
-
For each of the situations listed, identify the primary standard from the IMA Statement of Ethical Professional Practice that is violated (competence, confidentiality, integrity, or credibility.)...
-
Complete the following statements with one of the terms listed here. You may use a term more than once, and some terms may not be used at all. a. To quickly navigate to the end of the data in a...
Study smarter with the SolutionInn App