ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 23 May 2017 My Price 9.00

A typed or word-processed description of the design

INTRODUCTION We have described input and output of individual characters and we have mentioned the character functions that the library cctype provides. We have recently introduced and exercised arrays and their passage as parameters. This project applies all these ideas.

A palindrome is a string that reads the same forwards and backwards (ignoring spaces, punctuation, and capitalization). Examples are the familiar "Madam, I'm Adam" and the grander "A man, a plan, a canal, Panama."

DESCRIPTION In this project, you will write a program that determines and reports if an input string is a palindrome. INPUT The program will read an input line of characters. Any printable characters may appear in the input. The maximum length of the input is 80 characters. OUTPUT The program will prompt for the input line and will report whether or not the string that is input is a palindrome. ERRORS Your program may assume that the input is as described; it need not detect any errors. EXAMPLE Several runs of the program might look like this:

      > pal
      Enter a line that might be a palindrome:
      Madam, I'm Adam.
      The string is a palindrome.

      > pal
      Enter a line that might be a palindrome:
      Able was I ere I saw Elba.
      The string is a palindrome.

      > pal
      Enter a line that might be a palindrome:
      Go hang a salami; I'm a lasagna hog.
      The string is a palindrome.

      > pal
      Enter a line that might be a palindrome:
      This is another candidate string.
      The string is NOT a palindrome.
    

OTHER REQUIREMENTS Store the relevant characters (that is, letters) in order in an array, then examine that array to determine if the input string is a palindrome. Write functions to: (1) read the input line, keeping only its letters; (2) make sure all letters in a string are upper case; and (3) determine if the letters form a palindrome. HINTS The end-of-line character is not printable, so its ASCII value is less than that of the blank. Thus, this code will read an input line (assume appropriate declarations):

      cin.get(ch);
      while ( ch >= ' ' )
      {
        Process the character in ch.

        cin.get(ch);
      }
    

Don't forget to count the letters as they are read in. HAND IN Hand in the following:

  • A typed or word-processed description of the design of your program. As always, a naive reader should be able to reconstruct your solution (program) from this description. Don't forget to begin by describing the problem the program solves; this description cannot replicate any of the language of this posting.
  • A listing of the program, including appropriate comments.
  • A script file showing a variety of runs of the program.

Answers

(11)
Status NEW Posted 23 May 2017 02:05 AM My Price 9.00

-----------

Not Rated(0)