Write a recursive function which accepts a string

Assignment Help Programming Languages
Reference no: EM131110465

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: EM131110465

Questions Cloud

Calculate the us dollar translated figures : Calculate the U.S. dollar-translated figures for the two ending time periods, assuming that between December 31, 2112, and December 31, 2113, the euro has appreciated against the U.S. dollar by6%.
Explain the relationship among the gospels : How would you explain the relationship among the Gospels to someone who was not familiar with the Bible? Which Gospel do you think offers the best overview of the gospel of Jesus Christ? Why?
Define these three categories : Define these three categories, and use a two-dimensional figure to illustrate how the splitting is performed.
Required assignment two-analyzing risk : In this assignment, you will write an executive summary analyzing the exchange risks, country risks, and political risks the company executive team needs to be aware of in building a manufacturing facility in Brazil.
Write a recursive function which accepts a string : 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.
How this sample of data points is nonlinearly transformed : The example given in Fig. 5.1b depicts a spherically separable dictomy Assume that the four data points outside the separating surface lie on a circle and that the only data point inside lies at the center of the separating surface
Examine delusions more closely and weigh : Think about some examples of delusions that you may have encountered or witnessed in your recent experiences or that have been depicted in literature, plays, and film.
Calculate the first fundamental form of s : Let S be the surface parametrized by X: U → R3, where X(u, v)=(u, v, u2 - v2), Calculate the first fundamental form of S in terms of (u, v)
Defend your stance with research application : Do you think CMG is a successful company? Defend your stance with research application. How do CMG's resources support the company's competitive position?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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