C and C++ Programming Resources

Custom Search

Java

HighLow java Game

Posted on September 9th, 2008 0 Comments

his program lets the user play HighLow, a simple card game that is described in the output statements at the beginning of the main() routine. After the user plays several games, the user’s average score is reported. /******************************************************* * MYCPLUS Sample Code - http://www.mycplus.com * * ...
Read More | Make a Comment

Bank Operations using Threads in Java

Posted on September 9th, 2008 0 Comments

Bank Operation demo that uses Bank, Clerk and Account and Transaction objects to complete the operation. Actually this demo shows how you can use threads to perform the tasks intheir own capicity and utilise the maximum system resopurces. What we do is, we have two clerks and they will do the work seperately from each other hence they will work faster using threads....
Read More | Make a Comment

Count the words in a file – Java

Posted on September 9th, 2008 4 Comments

This program will read words from an input file, and count the number of occurrences of each word. The word data is written to an output file twice, once with the words in alphabetical order and once with the words ordered by number of occurrences. The input and output file names must be given as command line arguments when the program is run. The file uses...
Read More | Make a Comment

Java applet – HighLow Game

Posted on September 9th, 2008 1 Comment

This applet is a simple card game. The user sees a card and tries to predict whether the next card will be higher or lower. Aces are the lowest-valued cards. If the user makes three correct predictions, the user wins. If not, the user loses. This version of the game uses images of the cards, stored in a file smallcards.gif. Each card is 40 pixels wide...
Read More | Make a Comment

Show Volumes of Earth and Sun

Posted on September 9th, 2008 0 Comments

Show Volumes of Earth and Sun and their ratios /******************************************************* * MYCPLUS Sample Code - http://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided strictly for the * * purpose of illustration....
Read More | Make a Comment

Java network chat Applet

Posted on September 9th, 2008 0 Comments

This applet simulates a network chat, in which the user chats with someone over a network. Here, there is no network. The partner is simulated by a thread that emits strings at random. The point of the simulation is to show how to use a separate thread for receiving information. The applet has an input box where the user enters messages. When the user presses...
Read More | Make a Comment

Towers of Hanio Java Applet

Posted on September 9th, 2008 0 Comments

This applet solves the Towers of Hanoi problem for a tower of 10 disks. (Ten differntly-sized disks are stacked in a pile, in order of decreasing size. There are two other places for piles. The object is to move the pile to the second available place, subject to the rules that only one disk at a time can be moved, and no disk can be piled on top of a smaller...
Read More | Make a Comment

Keyboard Animation Applet – Java

Posted on September 9th, 2008 0 Comments

The KeyboardAnimation2 applet provides a generic framework for applets both display an animation and respond to keyboard events. The animation runs only when the applet has the keyboard focus and can respond to key presses. The appearance of the applet changes, depending on whether it has the keyboard focus. Note that each time a new frame...
Read More | Make a Comment


Page 5 of 6123456