C/C++

Searching for a word in a Dictionary - C Program

Submitted by davidwachira on
A program that searches for a word in a dictionary. - Create a small dictionary of strings - Not in order - Create an interface for user to search for a word in the dictionary If the word is not found, the word is added to the dictionary. The dictionary has 1000 words (English/Swahili) #include /* C Standard Input and Output Library*/ #define array_size 1000 /* Constant size of the array to be

Histogram of the frequencies of characters - C Program

Submitted by davidwachira on
A program written in C to print a histogram of the frequencies of different characters (printable) in its input as horizontal bars #include /* C Standard Input and Output Library*/ /*Variable declarations*/ char string_of_characters[200]; int character_frequency_counter; int counter; int print_histogram_counter; int output_counter; char frequency_array[26][2]={'a',0,'b',0,'c',0,'d',0,'e',0,'f',0

C Program - Cafeteria Rating

Submitted by davidwachira on
Fourty students were asked to rate the quality of food in the student cafeteria on a scale of 1 to 10(1 means awful and 10 means excellent) Place the 40 responses in an integer array and summarise and display the results of the poll #include /* Standard C Library*/ #define students 40 /* Constant students*/ #define max_rating 10 /* Constant max_rating*/ int cafeteria_rating_array[students][1]; /*

C Program to Search for Character in Array

Submitted by davidwachira on
A program that has a function to search per character in an array and return: - Yes, if the character is found - No, if the character is not found Function provided with array with constant data objects, constant pointer Main program: -To request user for character to search -To tell user whether character found or not #include /* C Standard Input and Output Library*/ #define array_size 40 /*

Matrix Multiplication - C Program

Submitted by davidwachira on
A program that can be used to multiply two matrices. It uses the following algorithm: Step 1: Make sure that the the number of columns in the 1st one equals the number of rows in the 2nd one. (The pre-requisite to be able to multiply) Step 2: Multiply the elements of each row of the first matrix by the elements of each column in the second matrix. Step 3: Add the products. #include //Variable

Airport Simulation

Submitted by Raj.Sharma on
Simulation of an Airport. There is a small busy airport with only one runway. In each unit of time one plane can land or one plane can take off, but not both. Planes arrive ready to land or to take off at random times, so at any given unit of time, the runway may be idle or a plane may be landing or taking off. There may be several planes waiting either to land or to take off. Follow the steps

Dictionary V1.0

Submitted by Raj.Sharma on
Program simulates a dictionary using linked list Each word added to the list can have maximum 5 meaning(s). Hence, variable used to store meaning(s) of a word would be a two dimensional character array. Features: 1. Add new word 2. Search Word 3. Show Dictionary This program can be used as mini project in C/C++. For students or anyone else who needs program or source code for thesis writing or any

Lift V1.0

Submitted by Raj.Sharma on
A program that demonstrates how an array can be used to show working of lifts in a multi-storeyed building. A 30- storeyed building has got about 5 wings where there would be a lift in each of the wing. You have to make available a lift to the person who presses a button to get a lift. Follow the steps given below for designing the program. 1. The floors of the building should be numbered as 0 -