CodeCheck® Java (Objects Early) Exercises

Assignments

With any of these assignments, click on the Clone button to use it in your class.

Programming Problems

Objects

  1. 371t3 hack3rs
  2. Average word length
  3. Rectangle construction
  4. Translate square so that intersection has area 10
  5. Red checkerboard squares
  6. Traffic light
  7. Make stronger password
  8. Reversing a string with StringBuilder
  9. Uppercase international letters
  10. Draw intersection of rectangles
  11. Rectangle with 3D effect
  12. Drawing with fill3DRect

Classes

  1. BankAccount with Service Charge
  2. BankAccount with Transaction Count
  3. BankAccount with Bonus for Opening Account
  4. ClassSchedule
  5. ClassSchedule with setDays and set times
  6. ClassSchedule with getDays and set times
  7. XML Map Labels
  8. XML Map Labels convert to decimal degrees

Fundamental Data Types

  1. Normalizing Angles
  2. Last n Characters
  3. Length of Line
  4. Initials
  5. Timer
  6. Decimal Degrees
  7. Degree, Minute, Second
  8. Distance between two points on earth
  9. Swap first and last name
  10. Change Firstname Lastname to Lastname, Firstname

Branches

  1. Employee Pay with Overtime
  2. Middle Letter
  3. Check for Valid Answers
  4. Overlapping sets
  5. Intersecting Lines
  6. Sort Names
  7. Number guessing game
  8. All the same
  9. All different
  10. All the same sign

Loops

  1. GetVowels
  2. EvenSum
  3. Stutter
  4. Count perfect squares
  5. Count Sevens
  6. Format Phone Number
  7. Color codes for double-sized image
  8. Run-Length Encoding
  9. Picture of Colored Boxes
  10. Balloon Filled Sky

Arrays and Array Lists

  1. List of numbers
  2. Short words
  3. Select a short word
  4. Diagonals on board
  5. Border on board
  6. Run lengths
  7. Same beginning and end sequence
  8. Remove short words
  9. Number of even and odd elements
  10. Letter frequency (count)
  11. Letter frequency (percentage)
  12. Swap first and second half of array
  13. Swap adjacent elements in array
  14. Railfence cypher

Designing Classes

  1. Reimplement Person class to increase cohesion
  2. Swap values by using an array
  3. Preconditions for Sentence constructor
  4. Static method for computing number of binary digits in n
  5. Static field to count number of objects
  6. Reimplement Vehicle class to increase cohesion
  7. Introduce class to implement method that mutates value
  8. Preconditions for SalaryBonus constructor
  9. Static method for counting the number of times a character appears in a string
  10. Static field to maintain the total value of Coin objects created

Inheritance

  1. Extend ASCII art rectangle to filled rectangle
  2. Extend ASCII art rectangle to tiled rectangle
  3. Implement LabeledPoint.toString
  4. Implement LabeledPoint.equals
  5. Implement Tile.translate
  6. Auto extending Vehicle and overriding getID
  7. Inherit and call a superclass constructor
  8. An enum type describing chemical elements
  9. Using an Abstract Class
  10. Overriding the equals Method

Interfaces

  1. Make Sentence implement Measurable
  2. Make a measurer for words
  3. Implement the Doublable interface
  4. Provide a RectangleDoubler class that implements the Doubler interface
  5. Implement an Interface to Change Rectangle Dimensions
  6. Implement an Interface to Provide Museum's Car Count
  7. Using Anonymous Objects
  8. Creating the Movement Interface
  9. Using instanceof for Converting Between Animal Types

Input and Output

  1. Reversing the lines in a file
  2. Find longest word in file
  3. Throw IllegalArgumentException in SavingsAccount constructor
  4. Catching a NumberFormatException
  5. Add throws clause to web reader
  6. Processing exam scores
  7. Processing names
  8. Converting temperatures
  9. Throw IllegalArgumentException in Vehicle constructor
  10. Design IllegalNumberOfWheels Exception

Object-Oriented Design

  1. Using inheritance for modeling Square class
  2. Using aggregation for modeling Square class
  3. Use Money interface in invoice program
  4. Add transfer to ATM
  5. Add user interface for balance transfer
  6. Collaborator classes
  7. Using Aggegation
  8. Relationships between classes and interfaces

Recursion

  1. Pyramid volume
  2. Zipper words
  3. Zipper words with helper method
  4. ZipperWordGenerator
  5. A recursive squid (square in diamond)
  6. Reverse an integer
  7. Reverse an integer with helper method
  8. Multiplication as recursive addition
  9. Recursive toString for array
  10. Reverse toString for array
  11. Extract uppercase letters from string
  12. Recursive string reversal with helper method
  13. Find vowels in string with recursive helper method

Sorting and Searching

  1. Modified SelectionSort
  2. Count visits in selection sort
  3. Count visits in selection sort
  4. Sort real data
  5. Number guesser
  6. Selection sort modification placing only min and max
  7. Selection sort modification placing even before odd
  8. Merge sort modification placing even before odd
  9. Descending merge sort
  10. Selection sort modification, placing the largest element first

Linear Data Structures

  1. Remove short words
  2. Duplicate short words
  3. Concatenate elements backwards
  4. Rotate linked list by manipulating nodes
  5. Using a stack for checking balanced parentheses
  6. Remove all but first two elements from linked list
  7. Add an element to the front and back of a linked list
  8. Add an element after the first and before the last
  9. Implement addLast using raw nodes
  10. Palindrome testing with stack and queue

Tree Structures

  1. Letter set
  2. Letter frequency map
  3. Path lengths in binary tree
  4. Hash code for LabeledPoint
  5. A fast priority queue
  6. Unique words in two string sets
  7. Map words to their lengths
  8. Map word lengths to words
  9. Hash code for Person class
  10. Make Person class comparable

Generic Types

  1. Generic matrix class as array of arrays
  2. Generic matrix class as linear array
  3. Generic matrix class as a map with integer keys
  4. Generic matrix class as a map with integer pair keys
  5. Pair class with compareTo method
  6. Generic pair with min method
  7. Generic method for filling an array
  8. Generic replicate method
  9. Finding the first match for a predicate
  10. Finding all matches for a predicate

Advanced Input and Output

  1. SuperCaesar Cipher
  2. HyperCaesar cipher
  3. Swap As and Os in RandomAccessFile
  4. Swap adjacent characters in a RandomAccessFile
  5. Reading a serialized array of objects

Concurrency

  1. Liftoff threads
  2. Synchronizing multiple summation threads
  3. Using conditions for completion count
  4. Launching multiple summation threads and using yield
  5. A slow sorting algorithm with two threads

XML

  1. Read XML from string or file.
  2. How many items in this RSS file?
  3. Get a title from an RSS file
  4. Get the version attribute from an RSS file
  5. Get the version attribute from an RSS file

Networking

  1. Oracle client
  2. Oracle server
  3. Cookies with raw sockets
  4. Cookies with URLConnection
  5. Popular boys and girls names

Bug Report Form

Your name:

Your email address:

Problem description:

To protect against spam robots, please answer this simple math problem:
* =