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 06 Jun 2017 My Price 8.00

Create a new class called Sentence

Create a new class called Sentence.

  • The constructor should accept a single parameter that is a string. Create an instance variable that stores the sentence as a string. Assume the sentence has no punctuation.
  • Write accessor method getSentence: Return the sentence as a string.
  • Write accessor method getWords: Return the list of words in the sentence.
  • Write accessor method getNumWords: Return the number of words in the sentence.
  • Write a mutator method for the Sentence class that allows you to capitalize all the words in a sentence.
  • Write a mutator method for the Sentence class that allows you to add a punctuation mark to the end of the sentence.
  • Add a str  method to the Sentence class
  • Implement the getitem method for the Sentence class. This method should allow you to use the index operator notation to access a word in the sentence.
  • Implement the len method so that you can use the len operator.
  • Implement the contains method so that you can ask if a word is in a sentence.
  • Implement the getslice method to allow you to retrieve portions of the sentence. The getslice method should return a Sentence consisting of the words indicated by the slice. For example, if the original sentence was a = Sentence ("the quick brown fox"), then a[1:3] should return the sentence consisting of the words "quick brown".
  • Implement the add method to allow you to concatenate two sentences together. Make sure your add method returns a new instance of Sentence.
  • Implement the frequencyTable  method that determine the word frequency of a sentence using a dictionary and print a frequency table
  • Write a function that tests all the above functions.

Answers

(11)
Status NEW Posted 06 Jun 2017 02:06 AM My Price 8.00

-----------

Not Rated(0)