Write a program to analyze a sentence provided by the user. Here are the criteria: ...
Fantastic news! We've Found the answer you've been seeking!
Question:
![](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/09/650a85a867937_1695188391180.jpg)
![](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/09/650a85b10cff0_1695188400131.jpg)
Transcribed Image Text:
Write a program to analyze a sentence provided by the user. Here are the criteria: • Your program "L6Qlinitials.py" must start with a commented academic integrity pledge, ID Box, and program purpose. EACH of the four functions in your p including the main function must state its purpose in comments too. • As strings are the focus of this question, lists and list methods are will be penalized heavily if used. • The main function in your program must be named: examin provided for you. Copy this function into your program def examine_string(): get_string() string explore_chars (string) count_uppercase (string) count Distrution of this string): and string. It has been as written: As you can see, examine_string get_string(): s Studes THREE helper functions namely: Prompt the user for a string of 8 or more characters ending with a question mark. Error the string to ensure it meets the criteria. Return the string. Academic Integrity Poliram pe propert explore_chars Determine and output the (a) string length, (b) third char, (c) third last char and er or not it is lowercase, (d) original string, and (e) the string after the first four chars with the last four chars. Distroution of this Count how many uppercase chars there are in the string and (f) display this amount together with the uppercase chars that were counted. The sample outputs provided next each show one example. Your output should be similar in layout but reflect whatever string is input by the user. c) >>> examine_string() Enter 8 or more chars ending with a question mark: -> 3 exams? (a) Length (b) 3rd char (c) 3rd last (d) Original (e) Swap 4 chars --> ams?3 ex (f) Uppercase amt -> 0 () (a) Length (b) 3rd char --> 8 chars ----> e >>> examine_string() Enter 8 or more chars ending with a question mark: -> TODAY? -> Incorrect try again: I wonder if it is toda -> Incorrect - try again: When is it DUE? --> m (lowercase) --> 3 exams? -----> 15 chars -----> e (c) 3rd last (d) Original (e) Swap 4 chars --> DUE? is (f) Uppercase amt -> 4. >>> examine_string() tribution of this assign fo ----> U (NOT ---> When is it Enter 8 or mor -> What? -> Incorre - try again: I don't understand. -> Inco try again: What TIME is it NOW? rity Policy ancentellectual property law. chars ending with a question mark: > 20 chars QUES When 3rd char ------> a 3rd last--> O (NOT lowercase) (d) Original -> What TIME is it NOW? (e) Swap 4 chars --> NOW? TIME is it What (f) Uppercase amt -> 8 (WTIMENOW) 2 Save the program as "L6Qlinitials.py" replacing initials with your actual initials. Submit your program electronically for marking. Write a program to analyze a sentence provided by the user. Here are the criteria: • Your program "L6Qlinitials.py" must start with a commented academic integrity pledge, ID Box, and program purpose. EACH of the four functions in your p including the main function must state its purpose in comments too. • As strings are the focus of this question, lists and list methods are will be penalized heavily if used. • The main function in your program must be named: examin provided for you. Copy this function into your program def examine_string(): get_string() string explore_chars (string) count_uppercase (string) count Distrution of this string): and string. It has been as written: As you can see, examine_string get_string(): s Studes THREE helper functions namely: Prompt the user for a string of 8 or more characters ending with a question mark. Error the string to ensure it meets the criteria. Return the string. Academic Integrity Poliram pe propert explore_chars Determine and output the (a) string length, (b) third char, (c) third last char and er or not it is lowercase, (d) original string, and (e) the string after the first four chars with the last four chars. Distroution of this Count how many uppercase chars there are in the string and (f) display this amount together with the uppercase chars that were counted. The sample outputs provided next each show one example. Your output should be similar in layout but reflect whatever string is input by the user. c) >>> examine_string() Enter 8 or more chars ending with a question mark: -> 3 exams? (a) Length (b) 3rd char (c) 3rd last (d) Original (e) Swap 4 chars --> ams?3 ex (f) Uppercase amt -> 0 () (a) Length (b) 3rd char --> 8 chars ----> e >>> examine_string() Enter 8 or more chars ending with a question mark: -> TODAY? -> Incorrect try again: I wonder if it is toda -> Incorrect - try again: When is it DUE? --> m (lowercase) --> 3 exams? -----> 15 chars -----> e (c) 3rd last (d) Original (e) Swap 4 chars --> DUE? is (f) Uppercase amt -> 4. >>> examine_string() tribution of this assign fo ----> U (NOT ---> When is it Enter 8 or mor -> What? -> Incorre - try again: I don't understand. -> Inco try again: What TIME is it NOW? rity Policy ancentellectual property law. chars ending with a question mark: > 20 chars QUES When 3rd char ------> a 3rd last--> O (NOT lowercase) (d) Original -> What TIME is it NOW? (e) Swap 4 chars --> NOW? TIME is it What (f) Uppercase amt -> 8 (WTIMENOW) 2 Save the program as "L6Qlinitials.py" replacing initials with your actual initials. Submit your program electronically for marking.
Expert Answer:
Answer rating: 100% (QA)
Heres a Python program that follows the specified requirements def getstring while True userinput in... View the full answer
Related Book For
A Concise Introduction to Logic
ISBN: 978-1305958098
13th edition
Authors: Patrick J. Hurley, Lori Watson
Posted Date:
Students also viewed these programming questions
-
Can technological advancements and digital divides exacerbate existing disparities in access to information, education, and employment opportunities, thereby reinforcing social stratification?
-
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...
-
1. Using the information from the financial statements below and the FCFF and FCFE formulas calculated using net income, estimate the following: 1. FCFF = NI + NCC + Int(1 - Tax rate) - FCInv- WCInv...
-
(a) Let k be any real number and a < 1. Show that the function (1+x)k has the following power series representation (1 + x) = (h)a = 1+ kx + ? -x + k(k-1) 2! n=0 The above series is called the...
-
Consider a 40-strike 180-day call with S = $40. Compute a delta-gamma-theta approximation for the value of the call after 1, 5, and 25 days. For each day, consider stock prices of $36 to $44.00 in...
-
Both the magnitude and the direction of the force on a crankshaft change as the crankshaft rotates. Find the torque on the crankshaft using the position and data shown in the figure. y 910 60 2000 lb
-
Describe the steps used to develop, execute, and evaluate an advertising program.
-
A 1125-kg car and a 2250-kg pickup truck approach a curve on the expressway that has a radius of 225 m. (a) At what angle should the highway engineer bank this curve so that vehicles traveling at...
-
Ayres Services acquired an asset for $96 million in 2021. The asset is depreciated for financial reporting purposes over four years on a straight-line basis (no residual value). For tax purposes the...
-
Punnett Square 2 shows a Punnett square describing a cross between two individuals from the F 1 generation. Was Punnett square 2 a good predictor of offspring phenotypes? Support your answer by...
-
Bill and Walter Framehouse were brothers who operated a profitable family farm near Leamington, Ontario. Like many in the farming community in Canada, Bill and Walter had inherited their farm and...
-
Briefly explain the difference between a k-factor model and the capital asset pricing model
-
Refer to the cost data, Picture below. Take off the square feet of wall forms and cubic yards of ready mix concrete for the walls of the elevator pit. Determine the total material and labor cost for...
-
possible Submit quiz A researcher studies water clarity at the same location in a lake on the same dates during the course of a year and repeats the measurements on the same dates 5 years later. The...
-
A liquid hydrocarbon mixture was made by adding 295 kg of benzene, 289 kg of toluene and 287 kg of p-xylene. Assume there is no change of volume upon mixing, i.e., Vmix=0 , in order to determine: 1....
-
b) Maseru Development Bank has R850 million credit with Matsieng Hydroelectric Power, with a maturity of eighteen months. The expected loss for Maseru Development Bank is R22 million, and the...
-
Cash $ 76,000 48,000 $ 11,000 33,000 73,000 13,000 Accounts Receivable Allowance for Uncollectible Accounts Inventory Building Accumulated Depreciation Land Accounts Payable Notes Payable (9%, due in...
-
Danielle has an insurance policy with a premium of $75 per month. In September she is in an accident and receives a bill worth $2990 for the repair of her own property. Her deductible is $250 and her...
-
Israels abandoning its settlements is a sufficient condition for the Palestinians declaring an end to hostilities. Translate the following statements into symbolic form using uppercase letters to...
-
Derive the conclusion of the following symbolized arguments. Use conditional proof or indirect proof as needed.
-
Use the eighteen rules of inference to derive the conclusions of the following symbolized arguments. 1. (GJ) (HQ) 2. J~Q 1~H
-
What are the three ways that ratios can be expressed? AppendixLO1
-
What is the purpose of profitability ratios? Explain earnings per share and the price-earnings ratio. AppendixLO1
-
What does a statement of stockholders' equity show? AppendixLO1
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App