Coder Social home page Coder Social logo

assignment-13's Introduction

Task 1

Work your way through the entire card/deck example of inheritance that is given in Chapter 18 of our book. By the time you finish, you should have created a file containing three classes (Deck() and Card() and Hand()). Be sure to include all the attributes/methods covered in the example. Also be sure to include the Deck.sort() method that is requested. You can use a main function to demonstrate (and show yourself) how these classes work independently and together.

Task 2

Rethink your word-counting code just a little bit. How could you parse and summarize words in a text file using an object-oriented approach? Write a class that operates generically, on any file, to summarize word counts. Specifically, write a class that includes or computes the following attributes:

  • file name (this is the name of the actual file)
  • file path (this is the path to the file)
  • total number of words in file
  • type of puncutation used in the file

And also that includes the following methods (these may not be all you need, just the ones you must have):

  • a method to count words
  • a method to count punctuation
  • a method to display both of these results

Your program should contain a main loop and an ifmain statement, it should be formatted correctly, and you should use argparse to get the name of the input file from the user. Your program should display, to the user, (1) the top 20 words and their counts, and (2) the top 10 puncation marks and their counts. You do not need to write any results to an outfile. Be sure to include the file(s) that you used to test/design your program.

assignment-13's People

Contributors

brantfaircloth avatar gcagle1 avatar glaudelrio avatar hensonmw avatar jonnations avatar jsalt avatar mforoozani1 avatar mukkuchagit avatar reige012 avatar sthshraddha avatar zcarver avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.