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...
-
The manager of the main laboratory facility at Rosedale Health Center is interested in being able to predict the overhead costs each month for the lab. The manager believes that total overhead varies...
-
The function z is defined by Find z and dz when x = 4, y = 3, x = 0.01 and y = 0.02. Z(x, y) = xy - 3y
-
Tom and Rika Nagata plan to retire in ten years. In 2004, they purchased three bonds: Two 20-year AT&T corporate bonds, each with a face value of \($1,000\) and 7 percent annual interest. The...
-
Steve Jackson (age 51) is a single taxpayer living at 3215 Pacific Dr., Del Mar, CA 92014. His Social Security number is 465-88-9415. In 2014, Steves earnings and income tax withholding as the...
-
Below is an article on recourse & nonrecourse liabilities in partnerships which I used to aid understanding of this topic in some of my accounting courses. While it is an older article, it has exc...
-
The irreversible first-order (wrt partial pressure of A) gas-phase reaction A B is carried out isothermally in a "fluidized" catalytic CSTR containing 50 kg of catalyst. Currently, 50% conversion is...
-
Consider the following information: State of Probability of Rate of Return if State Occurs Economy State of Economy Stock A Stock B Stock C Boom .18 .353 .453 .333 Good .42 .123 .103 .173 Poor Bust...
-
Where are the amounts obtained for the stockholders equity section of the balance sheet?
-
What action is required before a corporation can distribute income to its stockholder?
-
What account does a corporation use to record earnings not yet distributed to stockholders?
-
Under what major chart of accounts division are the owners' equity accounts for a corporation normally listed?
-
What accounts are used for the adjustment to office supplies?
-
The entry to journalize an Internet cash sale, is to debit CASH and a credit to: Question 5 options: Balance Sheet Debit column of the worksheet Consistent Reporting section of the company's 10K The...
-
7 A 29-year-old, previously healthy man suddenly collapses at a party where legal and illicit drugs are being used. Enroute to the hospital, he requires resuscitation with defibrillation to establish...
-
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.
-
List some principles to follow to stop fraud and abuse.
-
What are some incentives or pressures to misappropriate assets?
-
The 2004 Wells Report found which two measures to be more effective in preventing fraud?
Study smarter with the SolutionInn App