Stop-Watch Java Program

A component that acts as a simple stop-watch. When the user clicks on it, this componet starts timing. When the user clicks again, it displays the time between the two clicks. Clicking a third time starts another timer, etc. While it is timing, the label just displays...

BirthdayProblem Demonstration

How many random people do you have to select before you find a duplicate birthday (that is, two peole who were born on the same day of the same month, but not necessarily in the same year). This program simulates the process. (It ignores the possibility of people born...

Laout managers applet demo

This applet demonstrates various layout managers. The applet itself uses a border layout with a JPanel in the center, a JComboBox menu to the North, and a JLabel to the south. The center panel uses a CardLayout. Each card in the card layout contains a number of...

Count the words in a file – Java

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

Blackjack Java Game

In this applet, the user plays a game of Blackjack. The computer acts as the dealer. The user plays by clicking “Hit!” and “Stand!” buttons. The programming of this applet assumes that the applet is set up to be about 466 pixels wide and about...

Moving ball applet – Java

An object of type MovingBall holds data about a “ball” that has a color, radius, position, speed, and direction. The ball is restricted to moving around inside a rectangle in the xy-plane. The ball can draw itself in a graphics context and will move when...

Towers of Hanio Java Applet

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

Applet demonstrates recursion

This applet demonstrates recursion by counting the number of squares in a “blob”. The squares are arranged in a grid, and each position in the grid can be either empty or filled. A blob is defined to be a filled square and any square that can be reached...

GUI example

Example of a gui with different features. Java /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided strictly for the * * purpose of...

Different Borders Applet

A simple applet that shows labels with six different types of border. Java /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided...

SWAT GAME

SWAT GAME C++ /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided strictly for the * * purpose of illustration. * * * * Please...

Client and Overlapped Server and Server and ThreadServer

This program is a simple named pipe client that demonstrates the API calls needed to successfully develop a basic named pipe client application. When this application successfully connects to a named pipe, the message “This is a test” is written to the...

Car Race Game

This is a simple C++ program to make a car race game. It uses object oriented approach to generate different objects in the game such as using Car, Obstacle and Timer classes. The code draw objects using Graphics Mode by using initgraph() function. You have to reach...

Non-Trivial Class in C++

This date class is intended to illustrate how to write a non- trivial class in C++. Even though this class is non-trivial, it is still simple enough for a new C++ programmer to follow all of the details. C++ /******************************************************* *...

Database projects

This a database management project . C++ /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided strictly for the * * purpose of...

Information/Data Protection

Example of data protection in a very simple program. [code language=cpp]/******************************************************* * MYCPLUS Sample Code – https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided...

OOP

first hint of object oriented programming C++ /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided strictly for the * * purpose of...

C++ Program to simulate Cache Coherence mechanism Graphically

This C++ program simulates the cache coherence problem graphically. In computer architecture, cache coherence is the uniformity of shared resource data that ends up stored in multiple local caches. When clients in a system maintain caches of a common memory resource,...

Design patterns

“describe a problem which occurs over and over again in our environment, and then describe the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice” –...

constructors and destructors

constructors and destructors C++ /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided strictly for the * * purpose of illustration....