Counts and returns the number of vowels

Assignment Help Accounting Basics
Reference no: EM13917875

1a. Write a non-recursive function vowels() that accepts a character string and counts and returns the number of vowels (aeiou) in the string.

1b. Write a recursive function rvowels() that accepts a character string and counts and returns the number of vowels (aeiou) in the string. This solution should not include any loops. A global variable for the counter is acceptable. (Hint: one possible solution is to "chop" the string down until you are left with a single character.)

1c. Using the test string ‘this is a test to see if my program can accurately count the vowels' and the time operation described in the book on page 371 in the function timing, time the non-recursive solution and the recursive solution. Does this test provide any useable proof? Explain.

Place both your functions into one file. Dropbox your Word document showing all code and output, along with your Python file. In the Word document, include your answer to the above question: Does this test provide any useable proof? Explain.

2. Write a recursive function which accepts a string and its length and determines if the string is a palindrome. A palindrome is a string that reads the same frontwards and backwards. Hint: compare the first character with the last character. Equal or not? Go from there.

Reference no: EM13917875

Questions Cloud

Recruiting and staffing training program : Imagine you have been selected to conduct a recruiting and staffing training program for a group of new human resource management (HRM) employees at a health care company. You need to prepare a proposal for the organization outlining your strategy..
Stock expected return beta : Stock Expected Return (rs) Beta. What is the portfolio’s expected return? What is the portfolio’s beta risk? Is it more or less risky than the market? The investor is not comfortable with holding a portfolio that has a risk not equal to that of the m..
Dividends and dividends payable : a) Prepare the entries, if any, on each of the three dividend dates. b) How are dividends and dividends payable reported in the ?nancial statements prepared at December 31?
The following accounts and corresponding balances : The following accounts and corresponding balances were drawn from Crimson Sports, Inc.'s 2014 and 2013 year end balance sheets:
Counts and returns the number of vowels : Write a recursive function rvowels() that accepts a character string and counts and returns the number of vowels (aeiou) in the string. This solution should not include any loops. A global variable for the counter is acceptable. (Hint: one possibl..
First and second partial derivatives : Suppose that f(x; y) is a function of two variables with continuous first and second partial derivatives whose quadratic approximation about the point (2; 1) is Q(x; y) = 4 8(y  1)  (x  2)2 + 8(x  2)(y  1):
Pay for a trip overseas : You want to save $5,000 in three years time to pay for a trip overseas. How much money need you invest into a fixed deposit account, paying 5% per annum, for three years in order to reach your savings goal?
Which leadership styles did hasting use at pure software : Which leadership styles did Hasting use at Pure Software and Netflix? How effectively were these leadership styles used?
Cryptographic basis of the enigma machine : A 2,000-bit message is used to generate a 256-bit hash. One the average, how many other messages could be expected to generate the same hash value? What does this tell us about the length of a hash as compared to the length of the message?

Reviews

Write a Review

Accounting Basics Questions & Answers

  Assume that on january 1 2014 yard waste corp signs a

assume that on january 1 2014 yard waste corp. signs a 5-year noncancelable lease agreement to lease an

  What predetermined overhead rates would be used in

the westfield company uses predetermined overhead rates to applymanufacturing overhead to jobs. the predetermined

  Multigroup a pharmaceuticals mne based in switzerland

multigroup a pharmaceuticals mne based in switzerland decided to prepare consolidated financial statements for the

  Determine true cash balance by preparing bank reconciliation

Determine the true cash balance by preparing a bank reconciliation as of June 300, 2012, using the preceding information.

  Variable costs as a percentage of sales for leamon inc are

variable costs as a percentage of sales for leamon inc. are 61 current sales are 544415. and fixed costs are 209839.

  Explain to gary voss why bbg corps net income decreased in

bbg corp is a manufacturer of a synthetic chemical. gary voss president of the company has been eager to get the

  A company has a balance of 300000 in its common stock

a company has a balance of 300000 in its common stock account. the par-value of the common stock is 10share. the

  Access the internet to acquire copy of most recent annual

access the internet to acquire a copy of the most recent annual report for the publicly traded company used to complete

  How do falsified accounting procedures affect companies

How do falsified accounting procedures affect companies and stock and explain how this case can be used as a training tool in the healthcare environment holders.

  Present value of the debt

In transaction, determine the present value of the debt.

  Lady gaga enterprises on july 15 sells merchandise on

lady gaga enterprises on july 15 sells merchandise on account to usher iv co. for 1000 terms 210 n30. on july 20 usher

  What is the product unit cost for job 14 which consists of

what is the product unit cost for job 14 which consists of 300 units and has total manufacturing costs of direct

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd