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...
-
In 2017, Oswald Corporation reported a net loss of $56,000. Oswald's only net income adjustments were depreciation expense of $67,000 and an increase in accounts receivable of $8,100. Calculate...
-
The following is an energy- level diagram illustrating three different electronic transitions in the Bohr hydrogen atom. a. Explain why the energy levels get closer together as they increase. Provide...
-
Separation of Duties. Papagei Stuck Corporation fabricates products, using very expensive components purchased from suppliers. Therefore, the company attempts to tightly control raw materials...
-
Tobias Company reports the following information (in millions) during a recent year: net sales, $11,408.5; net earnings, $264.8; total assets, ending, $4,312.6; and total assets, beginning, $4,254.3....
-
Please show your work for each problem. Problem 1 - Average rate of return Determine the average rate of return for a project that is estimated to yield total income of $ 5 0 7 , 6 0 0 over five...
-
A professor obtains SAT scores and freshman grade point averages (GPAs) for a group of n = 15 college students. The SAT scores have a mean of M = 580 with SS = 22,400, and the GPAs have a mean of...
-
An automobile manufacturer buys a 1,000 radios per order from a supplier. When each shipment of 1,000 radios arrives, the automobile manufacturer takes a random sample of 10 radios from the shipment....
-
After you have selected your topic use the graphic organizer to help organize ideas for your draft. Genere Characteristics My details Setting What is the most logical time and place for this story?...
-
In the constant growth model, if the price of a stock today (Po) is $30 and the dividend of the stock is expected to grow at a rate of 10% each year, what will be the price of the stock three years...
-
How to the images and lyrics demonstrate toxic masculinity or hegemonic masculinity or emphasized femininity? Really think about this. There may be things that are there that are not obvious the...
-
Delve into the field of advanced transportation systems engineering, including intelligent transportation systems (ITS), traffic flow modeling, and optimization algorithms, to address complex...
-
Your employer offers a 4 0 1 ( k ) plan with a 2 3 % match, and you set a goal of retiring in 2 6 years with an amount of money which has the same buying power that 1 . 4 million dollars has today....
-
Name m the x- & y-axis. : y = tan(+) ymptotes: - y = -4csc ()- (+)-2 T: symptotes: L+ 4 ]
-
Keating & Partners is a law firm specializing in labour relations and employee-related work. It employs 25 professionals (5 partners and 20 managers) who work directly with its clients. The average...
-
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
-
Graph F. \(a ightarrow b ightarrow e ightarrow c ightarrow b ightarrow d ightarrow c ightarrow a\) Use the graphs from the given figures to determine whether the sequence of vertices in the given...
-
The following accounts are applicable to Walters Chimney Sweeps, Inc.: 1. Cash 8. Common Stock 2. Accounts Receivable 9. Retained Earnings 3. Supplies 10. Dividends 4. Prepaid Insurance 11. Service...
-
Bob Lutz opened a secretarial school called Best Secretarial Training, Inc. a. Lutz contributed the following assets to the business in exchange for 13,600 shares of $1 par value common stock: Cash...
Study smarter with the SolutionInn App