GithubHelp home page GithubHelp logo

cs549assignment2's Introduction

cs549-2

assgnment2

Write a program in either Java or C# for a card game. The program accepts a set of playing cards as input from only one pack (of 52 cards) and first arranges them in ascending order within their suits. For example, if the following set of cards is given as input,

the program must sort them.

The program must then compute the score for each suit by summing up the value for each card in that suit. For the score, the number cards have their own numeric values. Picture cards have the values as follows:

J = 11, Q = 12, K = 13 and A = 14

Accordingly, in the above example, the scores for each suit will be as follows:

Clover - 2 + 12 + 14 = 28 Hearts - 3 + 6 = 9 Spade - 6 + 7 + 11 = 24 Diamond - 4 + 6 + 9 + 13 = 32 Diamond has won in this game.

Notice that number of cards input to the program is random and hence each suit may get varying number of cards as shown in the example above. The program must output the following:

Input cards as given in the input (may accept from the keyboard or from a file) Cards in each suit sorted in ascending order Score for each suit The winning suit and its score You do not need to show the pictures for the cards. It is sufficient to indicate the suit and the value (for example, , <Diamond 3>, and so on).

Please make sure that your program well-documented, and hence is readable and understandable. It will be reused by another student in the class. Moreover, I need to understand the program as well. Remember that this exercise is to demonstrate reuse of code and hence the program must work correctly before someone can REuse it.

cs549assignment2's People

Contributors

alvinvinvinvin avatar

Watchers

James Cloos 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.