CS1 Course Site

CS1 at Oswego

Hypertexknowlogy

Frequently Asked Questions

 
CS1 Course Site  
 
 
 
Programming Challenge Archive

Incremental Programming
 
This programming challenge,  the fourth,  allowed us the opportunity to:   use incremental programming,  use,  once again,  problem decomposition,  use a counter controle loop,  use conditional constructs,  as well as compose various sorts of boolean-valued expressions,  and write some simple methods.  

The Problem :   File CardThing.data contains a textual representation of 50 pairs of cards.   Read 50 pairs of cards,  where each card is represented as a rank followed by a suit.   Display,  to the standard output stream,  the percent of the card pairs for which:

  • the ranks are the same
  • the suits are the same
  • neither the ranks nor the suits are the same
  • the cards are both red
  • the cards are both black
  1. Version 1
  2. Version 2
  3. Version 3
  4. Version 4
  5. Version 5
  6. Versoin 6