1. Write a function called tax_cost that accepts one parameter which represents a dollar amount before...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Write a function called tax_cost that accepts one parameter which represents a dollar amount before tax. The function should return the total amount that will be charged, including the tax. You should assume a tax rate of 13%. Example: If the dollar amount before tax is 2.00, then the total amount returned will be 2.26 2. Write a function called double_lis that accepts one list of numbers as a parameter. The function should return the list with all elements of the list doubled. It should NOT modify the parameter list. Example: if the list is [1,2,3,4] then the function will return [2,4,6,8]. However, if you print the list that was used as a parameter after calling the function with it, it will still produce the values [1,2,3,4]. 3. Write a function called sheep_goat that returns True if the string "sheep" and "goat" appear the same number of times. The function will accept one string as a parameter. Example: if the string is "sheepgoat" the function will return True because "sheep" and "goat" both appear exactly once in the string. If the string was "sheepsheep" then the function will return False because "sheep" appears twice, but "goat" appears 0 times. 4. Write a function called second half that accepts a string of even length as input parameter (string length could be 2, 4, 6, or so on). The function should return the second half of the string. Example: if the string is "Hello There" then the function just returns "There". If the string is "ToGo" then the function returns "Go". 5. Write a function called add_pairs that accepts two lists of integers as parameters. The function should return a new list that adds the pairs of integers from each list. You may assume that both lists are the same length, meaning you will always have equal pairs. 1. Write a function called tax_cost that accepts one parameter which represents a dollar amount before tax. The function should return the total amount that will be charged, including the tax. You should assume a tax rate of 13%. Example: If the dollar amount before tax is 2.00, then the total amount returned will be 2.26 2. Write a function called double_lis that accepts one list of numbers as a parameter. The function should return the list with all elements of the list doubled. It should NOT modify the parameter list. Example: if the list is [1,2,3,4] then the function will return [2,4,6,8]. However, if you print the list that was used as a parameter after calling the function with it, it will still produce the values [1,2,3,4]. 3. Write a function called sheep_goat that returns True if the string "sheep" and "goat" appear the same number of times. The function will accept one string as a parameter. Example: if the string is "sheepgoat" the function will return True because "sheep" and "goat" both appear exactly once in the string. If the string was "sheepsheep" then the function will return False because "sheep" appears twice, but "goat" appears 0 times. 4. Write a function called second half that accepts a string of even length as input parameter (string length could be 2, 4, 6, or so on). The function should return the second half of the string. Example: if the string is "Hello There" then the function just returns "There". If the string is "ToGo" then the function returns "Go". 5. Write a function called add_pairs that accepts two lists of integers as parameters. The function should return a new list that adds the pairs of integers from each list. You may assume that both lists are the same length, meaning you will always have equal pairs.
Expert 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
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
April Moon set a record in flight shooting. In 1981 in Utah, she sent an arrow a horizontal distance of 950 m. What was the speed of the arrow at the top of the flight if the arrow was launched at an...
-
In East Asia, many of online games rely on a business model that is different from the way the video-games industry works in the West. Rather than selling games as shrink wrapped retail products...
-
Use the valence molecular orbital configuration to determine which of the following species is expected to have the greatest electron affinity: (a) C 2 + ; (b) Be 2 ; (c) F 2 ; (d) B 2 + .
-
(a) A gallon of gasoline contains about \(1.4 \times 10^{8} \mathrm{~J}\) of chemical energy. A car consumes this amount of gasoline in approximately \(30 \mathrm{~min}\) when cruising along a...
-
Carp, Inc. wants to evaluate two methods of shipping their products. The following cash flows are associated with the alternatives: Use an interest rate of 15% and annual cash flow analysis to decide...
-
a) Money markets are used to trade debt securities and instruments with maturities of less than one year. Identify three characteristics of the money market. (6 marks) b) Explain four reasons for the...
-
Nearly everyone hates the idea of delivering a presentation live in front of an audience. Knees quiver, stomach aches begin, and your nervousness to the upcoming event is getting worse and worse....
-
You are planning to issue debt to finance a new project. The project will require $19.81 million in financing and you estimate its NPV to be $15 million. The issue costs for the debt will be 2.7% of...
-
The Manana Corporation had sales of $54.3 million this year. Its accounts receivable balance averaged $5.6 million. How long, on average, does it take the firm to collect on its sales?
-
The Saban Corporation is trying to decide whether to switch to a bank that will accommodate electronic funds transfers from Sabans customers. Sabans financial manager believes the new system would...
-
Your company has two divisions: One division sells software and the other division sells computers through a direct sales channel, primarily taking orders over the Internet. You have decided that...
-
The Fast Reader Company supplies bulletin board services to numerous hotel chains nationwide. The owner of the firm is investigating the desirability of employing a billing firm to do her billing and...
-
Your HR Director decided to revisit the company policy on selection due to high turnover among the companys middle managers. As an HR Manager, you are assigned to conduct an interview session with...
-
General Electric Capital, a division of General Electric, uses long-term debt extensively. In a recent year, GE Capital issued $11 billion in long-term debt to investors, then within days filed legal...
-
A Consider \[\begin{cases}\dot{x}_{1}=-x_{1}\left|x_{1} ight|+a x_{2}-\frac{2}{3}+\sin t & x_{1}(0)=\frac{2}{3} \\ \dot{x}_{2}=-x_{1}-\frac{1}{2} x_{2}-1, & x_{2}(0)=1\end{cases}\] where \(a\) is a...
-
A first-order dynamic system is modeled as \[\dot{y}+3 y=f(t), y(0)=1\] Assuming the input \(f(t)\) is a step function with magnitude 0.8 , find \(y_{s s}\).
-
The pendulum system in Figure 8.35 consists of a uniform thin rod of length \(l\) and a concentrated mass \(m\) at its tip. The friction at the pivot causes the system to be damped. When the angular...
Study smarter with the SolutionInn App