[25 pts] - Problem 1 - Gnirtsbus Write a function Gnirtsbus (no, your eyes are OK....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
[25 pts] - Problem 1 - Gnirtsbus Write a function Gnirtsbus (no, your eyes are OK. It is actually the reverse of "Substring") that takes two strings and prints whether the second is in the first or the first is in the second and in which order i.e. forward or backward (what!?). Example: Gnirtsbus ("focus", "autofocus") prints "focus" is in "autofocus" in forward order. Gnirtsbus ("lab rats", "star") prints "star" is in "lab rats" in reverse order. 125 pts] - Problem 2 - Check Order Write a program that reads an integer from the user and then prints whether the digits at even locations are sorted in ascending order and the ones in the odd locations are sorted in descending order. Assume the first digit on the left is at location 0. Example: If the user enters 162537 prints True (1<2<3 and 6>5>7) If the user enters 123456 prints False (1<3<5 but 2<4<6) [25 pts] - Problem 3 - Randomness Write a program that generates a password that is composed of your ID and Full Name after being scrambled and ignoring any spaces. Example: If your ID is 123 and your full name is "John Doe" then the password might be "J1 con3hD20". [25 pts] - Problem 4 - Arrows Write a program that draws the sequence of down and up arrows below. You should write a function that draws a down arrow, another one that draws an up arrow, and call them appropriately to draw the diagram. Once don, zip your files in a single archive file and upload them to the exam on Moodle. [25 pts] - Problem 1 - Gnirtsbus Write a function Gnirtsbus (no, your eyes are OK. It is actually the reverse of "Substring") that takes two strings and prints whether the second is in the first or the first is in the second and in which order i.e. forward or backward (what!?). Example: Gnirtsbus ("focus", "autofocus") prints "focus" is in "autofocus" in forward order. Gnirtsbus ("lab rats", "star") prints "star" is in "lab rats" in reverse order. 125 pts] - Problem 2 - Check Order Write a program that reads an integer from the user and then prints whether the digits at even locations are sorted in ascending order and the ones in the odd locations are sorted in descending order. Assume the first digit on the left is at location 0. Example: If the user enters 162537 prints True (1<2<3 and 6>5>7) If the user enters 123456 prints False (1<3<5 but 2<4<6) [25 pts] - Problem 3 - Randomness Write a program that generates a password that is composed of your ID and Full Name after being scrambled and ignoring any spaces. Example: If your ID is 123 and your full name is "John Doe" then the password might be "J1 con3hD20". [25 pts] - Problem 4 - Arrows Write a program that draws the sequence of down and up arrows below. You should write a function that draws a down arrow, another one that draws an up arrow, and call them appropriately to draw the diagram. Once don, zip your files in a single archive file and upload them to the exam on Moodle.
Expert Answer:
Answer rating: 100% (QA)
1 The second string is in the first string The first string is in the second string in reverse order ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
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...
-
Write a program that does the following: Reads an integer from the user that represents the number of the students in a class. Reads the scores of the students from the user and stores them in an...
-
Remember, most of the lab problems are mostly solved within the lab. So, if you can utilize your lab time, you can solve completely or most of the problem within the lab time This problem will be...
-
Mixing together solutions of acetic acid and sodium hydroxide can make a buffered solution. Explain. How does the amount of each solution added change the effectiveness of the buffer?
-
Henry Mintzberg identified three broad categories of roles that managers play. Briefly discuss the three broad categories. Give a workplace example of one of the roles contained in each category that...
-
Ralph Lauren Corporation is a global leader in the design marketing. and distribution of premium lifestyle products, including men's women's and children's apparel. Below are selected financial...
-
Use the data in Exercise 21 in Section 13.1 for the following. a. Compute a point estimate of the mean lifespan of butterflies with a wingspan of 30 millimeters. b. Construct a 95% confidence...
-
A study dealing with health care issues plans to take a sample survey of 1500 Americans to estimate the proportion who have health insurance and the mean dollar amount that Americans spent on health...
-
Sue purchased a rental house five years ago for $102,000. She had a new roof installed for $3,000, added a garage at a cost of $10,000, painted and installed new wallpaper at a cost of $350, and took...
-
Wild West produces two types of cowboy hats. A Type 1 hat requires twice as much labor time as a Type 2. If all the available labor time is dedicated to Type 2 alone, the company can produce a total...
-
Research that presents an analysis of a current (within the last 6 months) ethical situation that a specific company has confronted related to marketing in a global (non-US) setting or context by...
-
A 34-year-old man comes to the Emergency Department for review. He is HIV positive and continues to have unprotected sexual intercourse with males, despite having been warned not to, usually in...
-
What asset is used by watsonx.governance to organize all the models attempting to solve a single business problem?
-
what is the Audit Control Objective related to audit tools?
-
Cash =$10,000,Contributed Capital =$35,000 Beginning Retained Earnings =$11,000, Dividends =$8,000 Revenues =$55,000, Accounts Payable =$15,000 Equipment =$40,000, Expenses =$33,000 What is the net...
-
For the function f(x)=x' **1 calculate the compositions (fof)(x) and (fofof)(x). State the domain of each function. (fof)(x)= (fofof)(x)= Work: Domain: Domain:
-
4) (2 Points] Consider the following closed queueing network in which job sizes are Exponentially distributed. The service rate for each server is p =3 and # = 1, respectively. The value of p denotes...
-
You are maintaining a subsidiary ledger account for Police-Training Expenditures for 2013. The following columns are used: Inventory purchases are initially recorded as expenditures. Record the...
-
Bev and Ken Hair have been married for 3 years. They live at 3567 River Street, Springfield, MO 63126. Ken is a full-time student at Southwest Missouri State University (SMSU) and Bev works as an...
-
How are qualified dividends taxed in 2012? Please give the two rates of tax which apply to qualified dividends, and specify when each of these rates applies._________________________...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-7. Ivan sold the following securities during the year and received a Form 1099-B that...
-
The load resistor in the NMOS inverter in Figure \(16.3(\mathrm{a})\) is \(R_{D}=40 \mathrm{k} \Omega\). The circuit is biased at \(V_{D D}=3.3 \mathrm{~V}\). (a) Design the transistor...
-
The inverter circuit in Figure 16.3 (a) is biased at \(V_{D D}=3.3 \mathrm{~V}\). Assume the transistor conduction parameter is \(K_{n}=50 \mu \mathrm{A} / \mathrm{V}^{2}\). (a) Let \(R_{D}=100...
-
(a) Redesign the resistive load inverter in Figure 16.3 (a) so that the maximum power dissipation is \(0.25 \mathrm{~mW}\) with \(V_{D D}=3.3 \mathrm{~V}\) and \(v_{O}=0.15 \mathrm{~V}\) when the...
Study smarter with the SolutionInn App