Character string and counts and returns the number

Assignment Help Basic Computer Science
Reference no: EM13928886

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.

Additional Requirement

Reference no: EM13928886

Questions Cloud

First step in software development : You are designing an algorithm that will store a date as 01202009. Which data type would you choose for the datevariable?
What was the intrinsic value of this put : What was the premium on the Dec. BABA 118 put? Was this option in or out of the money? What was the intrinsic value of this put? What is the time value?
What is the formula for the intrinsic value of a call : What is the formula for the intrinsic value of a call? What was the intrinsic value of the Dec. 118 call? Was this option “in the money” or “out of the money”? What was the time value of this option?
Contrast rights of bond holders and preferred stockholders : Describe and contrast the rights of bond holders and preferred stockholders. Which has the best position in a default, which one would you buy all other things being equal.
Character string and counts and returns the number : 1a. Write a non-recursive function vowels() that accepts a character string and counts and returns the number of vowels (aeiou) in the string.
What is the amount of initial cash flow-expansion project : Jamestown Ltd. currently produces boat sails and is considering expanding its operations to include awnings for homes and travel trailers. The company owns land beside its current manufacturing facility that could be used for the expansion. This equi..
How much money is enough to live comfortable and sustainable : Terminating 100 employees that salaries range between $50K - $150K but continue to pay executives millions plus millions in bonus. That math and logic just doesn't seem to add up. So I ask again, how much money is enough to live a comfortable and ..
Record the acquisition in a financial statements model : Record the acquisition in a financial statements model like the preceding one.
Use black-scholes-merton model to price this put option : Consider a 6-month European put on GOOG with a strike price of $650. GOOG spot price is $725 and its volatility is 25%. The stock is not expected to pay any dividend. The risk-free rate is 4%. Use Black-Scholes-Merton (BSM) model to price this put op..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Determine the top three things that the head of it

Determine the top three things that the head of IT should be doing to improve the skills of the IT staff.

  Describe various types of dos attacks and techniques for pre

Describe various types of DoS attacks and techniques for preventingthem

  Add the following numbers in two''s complements

Given four bits, add the following numbers in two's complements. a. - 4 + (- 1), b. -7 + 3, c. -5 + 4

  Explain process of extracting contours from edge image

Assume that the edge points in an image are extracted using a robust edge detection. Explain the process of extracting the contours from this edge image.

  Project in designated area of coastal zone is significant

Have you contacted State Historic Preservation Office (SHPO) to see if the project is in designated area of coastal zone which is significant to the study, understanding, or illustration of national, state.

  Social networking website to get information about applicant

Some companies are beginning to use social networking websites like Facebook and MySpace, to get information about job applicants.

  Explain material protected under all copyright laws

All rights reserved. This material is protected under all copyright laws as they presently exist. No portion of this material may be reproduced, in any form or by any means, without permission in writing from publisher.

  A selection with a single action

Question 1.1. (TCO 4) Which pseudocode keyword is not included in a selection with a single action? (Points : 2)IfThenElseEnd If

  Find the largest storage capacity design

Find the tallest water tower design, h . Find the largest storage capacity design. Find four other Pareto solutions that are significantly different from any other design you have obtained. How do you compare your designs to decide the extent to whic..

  Use a block diagram for the decoder

Implement the circuit with a 3x8 decoder and OR gates. Use a block diagram for the decoder.

  Convert number f(t) decaying each minute to the number r(t)

Radioactive carbon 11 has a decay rate k of 0.0338 per minute-that is, a particular C11 atom has a 3.38% chance of decaying in any one minute. Suppose we start with 100 such atoms.

  How easy or difficult would it be to initiate such advantage

More generally, to what extent do specific technologies help companies gain an edge over their competitors? How easy or difficult would it be to initiate such advantages?

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