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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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