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:
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...
-
The uniform rod AB of mass m and length L is attached to two blocks which slide freely in circular slots as shown. Knowing that the rod is in equilibrium and that at L = 2R, determine (a) The angle...
-
The micrograph shows an artery and a vein. Which row correctly identifies and describes the artery and the vein? X Y
-
Consider a short rate binomial lattice where the risk-free rate at \(t=0\) is \(10 \%\). At \(t=1\) the rate is either \(10 \%\) (for the upper node) or \(0 \%\) (for the lower node). Trace out the...
-
On January 1, 2010, Porter Company purchased an 80% interest in the capital stock of Salem Company for $850,000. At that time, Salem Company had capital stock of $550,000 and retained earnings of...
-
Selected transactions for Sunland Company are presented below in journal form (without explanations). Date Account Title Debit Credit May 5 Accounts Receivable 3,850 Service Revenue 3,850 12 12 Cash...
-
A month has elapsed since Precision Computer Centres year-end. Tony Freedman will use four specialized journals for recording business transactions in the month of Septembertwo in this chapter, and...
-
Group #1 Discussion Topic: Combining Quantitative and Communication Skills ( LO 12.1 , LO 12.4 , LO 12.5 , LO 12.6 ) Lloyd C. Blankfein, chair and CEO of Goldman Sachs, was asked, "What would you...
-
How do plaintiffs and defendants benefit from Mary Carter and Gallagher agreements?
-
What do Mary Carter agreements typically provide, and how do they differ from Gallagher agreements?
-
True Or False For the family purpose doctrine to apply the driver must be a relative of the owner.
-
True Or False The family-purpose doctrine has been adopted in almost every state.
-
Which factors would a financial services sector company consider when assessing the suitability of its product for Internet sales?
-
Prepare a Common Size Income Statement and Common size Statement of Financial Positions for the years 2021 and 2022 Company Statement of Changes in Equity Year ended 31 December 2021 Balance at 1...
-
The Zwatch Company manufactures trendy, high-quality moderately priced watches. As Zwatch's senior financial analyst, you are asked to recommend a method of inventory costing. The CFO will use your...
-
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
-
Consider the multiple linear regression model fit to the baseball data in Problem 3.41. Problem 3.41 Consider the 2016 major league baseball data in Table B.22. While team ERA was useful in...
-
Consider the simple linear regression model fit to the rental price data from Problem 2.36. Data From Problem 2.36 Table B.24 contains data on median family home rental price and other data for 51 US...
-
Consider the multiple linear regression model fit to the rental price data in Problem 3.42. Problem 3.42 Table B.24 contains data on median family home rental price and other data for 51 US cities....
Study smarter with the SolutionInn App