C project on TypeWriter

Computer Science & Engineering Discipline,

Khulna University, Khulna.

Type Writer Project in C

Submitted by

Student ID                   Name

180226   –    Md. Shazzadul Ahsan

180229   –    Md. Ashadousjaman Rony

180232   –    Mehedi Hasan Shanto

180235   –    Md. Azizul Haque.

 

 

Introduction: Typing is the basic command to run a computer and your typing speed plays vital role while working in computer to save time. Here I have presented a Typing Tutor Project in C to measure user’s typing speed and to enhance their typing speed. This is a simple console application written in C programming language, and compiled using GNU GCC compiler on Code::Blocks IDE.

The source code of Typing Tutor Project in C consists of over 250+lines of code. The project source code effectively utilizes the user defined functions and the concept of file handling. You can directly download the application file and source code of this project from the link below.

How to play

  • Download the project files from google drive… or github…

    note: keep main.cpp, first.txt and typingHistory.txt in the same directory…

  • Firstly when you run the game you will see the start menu with multiple options. The outlook will be like this…

  • If you choose option ‘1’ to play game from the keyboard , you will get a window.. here

Enter your name here to save your data, you can start typing now as following text

Then you get your typing accuracy and typing speed in WPM with mistakes and get a window like this

Press ‘2’ to show the main menu from any where… here is the link…

  • We keep some instruction for you in option ‘3’ like this… link…

  • Press ‘4’ for history in this game. As you can compare with others…
    You can compare you accuracy and word. You will also see your typing time

link…

Important function use in Project

The major user defined functions used in the source code of this project are:

strtok(): strtok() is one of the inbuilt string function in c programming which is used to split the given string with the given character. The following diagram clearly illustrate the working principle of strtok() :- link

strtok() split the string into parts, wherever the given character is present in the string. Splitting is done by replacing a user mentioned delimitting character with ‘\0’ i.e) Null character.

Syntax –strtok()

  • strtok() accepts two parameters,

  • First parameter must be a string and second parameter must be a character.

  • Second parameter must be a delimiting characters like , : ;

  • To use strtok() inbuilt string functions in C, we need to declare #include<string.h> header file.

  • Syntax

strtok(string, charecter);

gets():

The C library function char *gets(char *str) reads a line from stdin and stores it into the string pointed to by str. It stops when either the newline character is read or when the end-of-file is reached, whichever comes first.

Declaration

char *gets(char *str)

Parameters

  • str − This is the pointer to an array of chars where the C string is stored.

Return Value

This function returns str on success, and NULL on error or when end of file occurs, while no characters have been read.

fopen():The C library function FILE *fopen(const char *filename, const char *mode) opens the filename pointed to, by filename using the given mode.

Following is the declaration for fopen() function.

FILE *fopen(const char *filename, const char *mode);

Parameters

  • Filename − This is the C string containing the name of the file to be opened.

  • Mode − This is the C string containing a file access mode. It includes −

Sr.No.

Mode & Description

1

“r”

Opens a file for reading. The file must exist.

2

“w”

Creates an empty file for writing. If a file with the same name already exists, its content is erased and the file is considered as a new empty file.

3

“a”

Appends to a file. Writing operations, append data at the end of the file. The file is created if it does not exist.

4

“r+”

Opens a file to update both reading and writing. The file must exist.

5

“w+”

Creates an empty file for both reading and writing.

6

“a+”

Opens a file for reading and appending.

Return Value

This function returns a FILE pointer. Otherwise, NULL is returned and the global variable errno is set to indicate the error.

fclose():The C library function int fclose(FILE *stream) closes the stream. All buffers are flushed.

Declaration

Following is the declaration for fclose() function.

int fclose(FILE *stream);

Parameters

  • Stream − This is the pointer to a FILE object that specifies the stream to be closed.

Return Value

This method returns zero if the stream is successfully closed. On failure, EOF is returned.

fprintf():

The C library function int fprintf(FILE *stream, const char *format, …)sends formatted output to a stream.

Declaration:

Following is the declaration for fprintf() function.

int fprintf(FILE *stream, const char *format, …);

fseek():The C library function int fseek(FILE *stream, long int offset, int whence) sets the file position of the stream to the given offset.

Declaration

Following is the declaration for fseek() function.

int fseek(FILE *stream, long int offset, int whence);

fgets():The C library function char *fgets(char *str, int n, FILE *stream) reads a line from the specified stream and stores it into the string pointed to by str. It stops when either (n-1) characters are read, the newline character is read, or the end-of-file is reached, whichever comes first.

Declaration

Following is the declaration for fgets() function.

char *fgets(char *str, int n, FILE *stream)

Parameters

  • str − This is the pointer to an array of chars where the string read is stored.

  • n − This is the maximum number of characters to be read (including the final null-character). Usually, the length of the array passed as str is used.

  • stream − This is the pointer to a FILE object that identifies the stream where characters are read from.

Return Value

On success, the function returns the same str parameter. If the End-of-File is encountered and no characters have been read, the contents of str remain unchanged and a null pointer is returned.

If an error occurs, a null pointer is returned.

rewind():

The C library function void rewind(FILE *stream) sets the file position to the beginning of the file of the given stream.

Declaration

Following is the declaration for rewind() function.

void rewind(FILE *stream)

Parameters

  • stream − This is the pointer to a FILE object that identifies the stream.

Returns: This function does not return any value.

ftell():

Description

The C library function long int ftell(FILE *stream) returns the current file position of the given stream.

Declaration

Following is the declaration for ftell() function.

long int ftell(FILE *stream);

Parameters

  • stream − This is the pointer to a FILE object that identifies the stream.

Return Value

This function returns the current value of the position indicator. If an error occurs, -1L is returned, and the global variable errno is set to a positive value.

srand():

Description

The C library function void srand(unsigned int seed) seeds the random number generator used by the function rand.

Declaration

Following is the declaration for srand() function.

void srand(unsigned int seed);

Parameters

  • seed − This is an integer value to be used as seed by the pseudo-random number generator algorithm.

Return Value

This function does not return any value.

We use this function to take random input from file.

system():

The C library function int system(const char *command) passes the command name or program name specified by command to the host environment to be executed by the command processor and returns after the command has been completed.

Declaration

Following is the declaration for system() function.

int system(const char *command)

Parameters

  • command − This is the C string containing the name of the requested variable.

This is very useful function to clear screen at run time of the program

rand():

The C library function int rand(void) returns a pseudo-random number in the range of 0 to RAND_MAX.

RAND_MAX is a constant whose default value may vary between implementations but it is granted to be at least 32767.

Features:

  • This project provides certain name as user by default and there a facility to create a new user too. You can enter your name as user.

  • In the project, you can view the total statistics.

  • The record option in the project is for displaying the data of user which has already used the application. you can view typing speed, accuracy.

  • If you want to terminate the program without any use, you can select exit option in the main menu.

Thank you

A Calendar Event Management Program Using C

 

 

ABSTRACT:  We have made a Calendar Event Management program using ‘C’ programming language. We approached in a structured way. As ‘C’ is a Structured Programming Language, so we used ‘C’ to write the program. To keep all tasks organized was our main goal. So, we made a calendar program so that one can add events on a particular date. It will help one to keep up to date with one’s work.

 

INDEX TERMS: Introduction, Preprocessor Directives, User Defined Functions ,Time Function, Graphical Function.

 

INTRODUCTION: Our calendar is in year view. To write the program we used ‘CODE BLOCKS’ as IDE. We made a ‘Today’s date’ feature, point today’s date feature, go to date feature, add task feature in the program. First, we made a program just to make a calendar. Then using graphics, we printed the calendar on the console. Then to beautify the program we made a load screen containing today’s date .

 

PREPROCESSOR DIRECTIVES: To access current date and time we need to use the ‘time.h’ preprocessor directive. As we also used graphical function we used ‘graphics.h’ and ‘windows.h’ preprocessor. To use graphics.h we need to download the header file and install the header in our IDE. One can get instruction on how to download and install here. To use ‘C’ standard library functions we used ‘stdio.h’ and ‘stdlib.h’ preprocessor directives.

Preprocessor Directives: 

https://drive.google.com/file/d/170haDP0wfH4eDdrhv_RI_8tpuhfBF5v_/view?usp=sharing

TIME FUNCTION: As we added ‘Today’s date’ feature so it was must to use ‘time.h’ header. The time.h header defines four variable types, two macro and various functions for manipulating date and time. There are four types of variable types in ‘time.h’ preprocessor directive.

 

  1. size_t

This is the unsigned integral type and is the result of the sizeof keyword.

  1. clock_t

This is a type suitable for storing the processor time.

  1. time_t

This is a type suitable for storing the calendar time.

  1. struct tm

This is structure use to hold the time and date.

 

Here in our program used ‘time_t’ and ‘struct tm’ type variable.

The tm structure has the following definition –

 

 

struct tm    {

int tm sec;             /* seconds, range 0 to 59 */

int tm min;            /* minutes, range 0 to 59 */

int tm hour;          /* hours, range 0 to 23 */

int tm mday;         /* day of month, range 1 to 31 */

int tm mon;           /* month, range 0 to 11 */

int tm year;           /* the number of years since 1900 */

int tm wday;         /* day of the week, range 0 to 6 */

int tm yday;          /* day in the year, range 0 to 365 */

int tm isdst;          /* daylight saving time */

}

 

We also used the time() function in the program. The C library function time_t time(time_t *seconds) returns the time since the Epoch (00:00:00 UTC, January 1, 1970), measured in seconds. If seconds is not NULL, the return value is also stored in variable seconds.

 

We declared the time() function as “time(time_t current time)” in the progam.

 

 

GRAPHICAL FUNCTION:

In our program we used some graphics function to beautify our program. Graphic functions that we used are

  1. initgraph();
  2. bar();
  3. setcolor();
  4. setfillstyle();
  5. floodfill();
  6. moveto();
  7. settextstyle();
  8. outtextxy();
  9. cleardevice();
  10. closegraph();

 

 

  1. initgraph();

          To use the graphical console we need to initialize the graphical drive which is already in our computer. So we use the initgraph() function to initialize the graphic drive.

To use this function we need to type “initgraph(&gd,&gm,”path”)”.

This way we initialize the graphic drive.

  1. bar()

Bar function is used to draw a 2-dimensional, rectangular filled in bar. Coordinates of left top and right bottom corner are required to draw the bar. Left specifies the X-coordinate of top left corner, top specifies the Y-coordinate of top left corner, right specifies the X-coordinate of right bottom corner, bottom specifies the Y-coordinate of right bottom corner.  

                   
Declaration: void bar(int left, int top, int right, int bottom);

  1. setcolor()

 In  graphics each color is assigned a number. Total 16 colors are available. Strictly speaking number of available colors depends on current graphics mode and driver. For Example: – BLACK is assigned 0, RED is assigned 4 etc. setcolor() function is used to change the current drawing color e.g. setcolor(RED) or setcolor(4) changes the current drawing color to RED. The  default drawing color is WHITE.

                    Declaration: void setcolor(int color);

  1. setfillstyle()

setfillstyle() function sets the current fill pattern and fill color.

 

Declaration: void setfillstyle( int pattern, int color);

  1. floodfill()

floodfill function is used to fill an enclosed area. Current fill pattern and fill color is used to fill the area. (x, y) is any point on the screen if (x,y) lies inside the area then inside will be filled otherwise outside will be filled, border specifies the color of boundary of area.

 

Declaration: void floodfill(int x, int y, int border);

  1. moveto()

move() function is used to move to a particular coordinate.

 

Declaration : void moveto(int x, int y);

  1. settextstyle()

 

settextstyle() function is used to set the font style , direction and font size in a program. There are various types of font style which all are represented by some number in the function.

 

Declaration: void settextstyle(int font, int direction, int charsize);

 

  1. outtextxy()

 

outtextxy() function is used to print something on the graphical console. This function let’s a programmer to print some thing on the graphical console in a particular coordinate. Programmer can choose where to print the output on the graphical interface.

 

Declaration: void outtextxy(int x, int y, char* textstring);

 

  1. cleardevice();

 

cleardevice function clears the screen in graphics mode and sets the current position to (0,0). Clearing the screen consists of filling the screen with current background color.

 

Declaration :  void cleardevice();

  1. closegraph();

This function is used to close the graphic drive we initialized before.

 

Declaration : void closegraph();

 

 

Along with these functions we also used GetsystemMetrics() function to get the graphical console full screen and GetAsyncKeyState() to read keys from the keyboard.

 

 

 

USER DEFINED FUNCTIONS:

 

We made four functions in our program. They are GetStartingDay(), Today(),  Calendar(), and LoadingScreen().  The function of the GetStartingDay() is to fetch the first day of the year. Function of Today() ,  is to show today’s date int the loading screen. Caldendar() function was created to print the calendar in the graphical console. And last the LoadingScreen() function’s work is to show the load screen.

GetStartingDay() : https://drive.google.com/open?id=1MveHuxtsn401bk5qHdXiYYmtjPdEkn8N

Today(): https://drive.google.com/open?id=1ixX27bvyUpgMZ9RSB0y31j9aWWnLi9UZ

LoadingScreen():

https://drive.google.com/open?id=1-R2JYQWJ3hNEY5CjG0FMsgjYVs35CGD1

 

HOW TO USE CALENDAR EVENT MANAGEMENT:

 

 

After loading screen ends we will have the calendar page. The calendar is in year view. The default year is the current year. To shift to the next year, one need to press the ‘Right Arrow’ button and to shift to the previous year press the ‘Left Arrow’ button. To go to particular year, one must press the ‘Right Shift’ button. Then there will appear another console where one must enter the year which he/she wants to see. After the input, pressing enter one can see the year he/she wants. To see all holidays in that year one has to press ‘Space’ key from the keyboard. To add events on a particular date one have to press ‘Tab’ button from the keyboard. After adding event one can see the date on which the event has been created.  Pressing ‘Esc’ one can exit the graphical console.

This way one can use our ‘Calendar Event Management’ program.

 

 

Loading Screen : https://drive.google.com/open?id=197vq6jKFMXRNVF3EcZ2s9XWyt1Y1gJSY

 

Calendar :

https://drive.google.com/open?id=1bL6hzvId2U_RDZPJ63cfJNrN5rUQ8kCJ

 

Year:

https://drive.google.com/open?id=195JJsKDYKyoNfDXHYAD3UTCeiiBEncQC

 

Event:

https://drive.google.com/open?id=11rfph-lG0Nn0JhLC7zaufYK0–qxHMiR

 

 

 

 

DOWNLOAD: Download our source code here.

Thank You.

 

 

 

Authors: Mridha Imran Kabir(180202), Aldrin Saurov Sarker(180204), Vashkar Kar(180207) and Md. Nazmul Abdal(180225).

Computer Science and Engineering Discipline, Khulna University, Khulna.

 

Any 4 Secrets of Strong Relationships

So often a woman finds herself thoroughly a part of the woman’s guy to find out in fact that this individual could be many to agree. This can be demoralizing and unsatisfying, to never imply middle breaking. To prevent yourself from this it is better to understand from his reasons in advance so that you can aren’t apologies later! This you should know if he has been set on you will or not.

Bond Advice – How To Show If You Are Within a Toxic Relationship

Jump relationships do not need a really good name, along with a lot of persons indicating intuition behind how come they’re a bad theory. However, there is the ideal that comes there all at once. Why not try these significant reasons why coming about any rebound is not actually necessary that hardest condition for you to do after the end of any long-term relationship.

Cover bet you will did not very like me starting off possible one particular. Did you think we had arrived very likely to deal with oneself? The single thing you can actually actually control while in the union is yourself, inside present moment. Thus begin just by pondering everything that requires to be much better throughout you. The thing this is certainly to get a better utilized to any partnership. Should you up keep your side when using the street, it’s likely any reactions from the spouse shall be confident and they’ll startup a meeting halfway. It might be recommended that you de-stress to get yourself a short while. Rather then ranked difficulty toward problem quality, withdraw, and find slightly introspective on your very own attitudes and contributions to the text, the two negative and positive. japan cupid scam

Fin uses a lot of our suffering and pain to maneuver you and me to at which he desires us to become. Any human types of conditions of serious pain and experiencing results in an individuals reaction to ameliorate these conditions. Whenever there is also a need to have there builds up an outreach to satisfy having a. Fin often is the that utilize that anguish while we are inclined as Hannah to produce away to her pertaining to reap some benefits and His glory. Hannah cannot understand at the start of the girl’s spiritual journey whatever was that blueprint from God. She did having said that an abundance of faith in Goodness to pass through the task assuming He could possibly solve her problem. Alright, so what did the girl do, your woman seemed to Fin. Through the girl’s pain and suffering your lady understood the fact that she was first started by Who. She previously had positioned very little designed for the divine one-on-one expertise with Fin. Hannah later happened on appreciate her suffering was put to use by Who to draw in the woman’s more detailed Her. She is willing to achieve to the site Fin and alternative mystery problem the one that with regards to the pain drives me better The lord because We are identified by Her. She identified that The person alone was sovereign. The woman’s husband could hardly touching her on those sites were the girl was abusing. God was the only one which could possibly relieve all the suffering and he or she is driven to him to attach the woman’s problem.

Each couple endures challenging times, they determine the stuff make a distinction them, details that get them to unique and they offer problems for mismatch between them. Try and also discover the items which can certainly make you two works with bigger importance, and think everyone dissimilarities are in reality supporting. You are distinctive, but in general complement that differences in something special. Visualize how some of those differences, rather than as a general stumbling block, could actually help and makes sense to make the marriage a lot more distinctive.

Probably the most Common Rapport Challenges

Holidays might possibly be the time period whenever you contemplate it wise expressing ourself with a loved. It really is the amount of time to touch base using family, remembering some of our roots. It is additionally a little extra time for the purpose of reflection: Some other year relocated through… What were my needs there is much surprise? Have got I moved on inside direction I wanted to make sure you? For solo people that are on the lookout for your daily life spouse this may be a bitter realization: Some other year adjusted just by; I have always been still sole. It hasn’t happened…

Alicia Florrick (Julianna Margulies ) stands out as the better half of Philip Florrick (Chris North ), Cook Regional State’s Lawyer who was simply caught for politics corruption. At the time of his trial, loads of an individual’s private life, even no matter your partner’s wife was first unaware of, came to light. He’d affairs by means of women, several of which this individual even paid out to possess having sex. Alicia presenting to commence to help you rebuild the girl’s life and take monetary responsibility because of their a few children, Zach and Leeway. Her background in rules affords her to be able to turn back into the particular field as your woman features a project like a younger litigator at Lockhart & Gardner. Might Gardner (Josh Charles ), 50 % from Lockhart & Gardner, has jewelry to Alicia which usually go time for their days within Georgetown. They are simply as interested in each other at this point though they ended up being with college. Points have been for a while differently had the pair of them formulated a healthier bond although she in the near future met Philip and the snooze is past.

Outlines For Easy Methods Of https://mygreatminds.com/if-you-can-do-these-4-things-together-your-relationship-is-more-likely-to-last-forever/healthy-relationship-secrets/ When a quarter-hour, 1 hour, as well as a full week in accordance with how substantial the whack was, nowadays set out to bring a good merchant accounts in the best way poor the damage is normally. At this point you include cultivated taking the situation and you’ll initiate their work for the choice. Before you obtain for the purpose of the resolution nevertheless you ought to be capable to categorize each of the types of conditions any incident is principally responsible for you.

Yet another thing you should prevent from the dialogue is putting at fault on the other software someone, or simply any one by way of example. Usually do not blame ones better half, don’t pin the consequence on your sons or daughters and will not responsibility friends. This would not choose decent especially if the someone that you are making that blame for cannot help with what was needed while using the trouble.

Response quantity 2. IF your fiscal affairs are actually in order after that there is little or nothing left that you both private, or simply nothing that will need the interest from the two those people, then alternative is no. You really implement n’t want to keep up in touch with he or she. All the divorce was because of cheating spouse, cerebral or physical abuse or simply something like who of the serious nature. It’s best to really in no way keep hold of a professional that way. They will help to make an attempt to pull you during with their community every chance they obtain.