Sunday, August 11, 2019

Student Record System in C

A simple student record system that I wrote in C language using Turbo C compiler in DOS a long time ago.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

student_db.c


#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <ctype.h>
#include <string.h>

main( )
{
FILE  *fp, *ft ;
char  another, choice ;
struct student
{
char  stud_id[200];
char  name[200];
char  course[200];
char  sex;
int   age;
char  address[200];
char  email[200];
char  subject[200];
float prelim,midterm,endterm,final_grade;
} ;

struct student info ;
char student_id[200];
int flag=0;

long int  recsize ;

fp = fopen ( "BIODATA.DAT", "rb+" ) ;

if ( fp == NULL )
{
fp = fopen ( "BIODATA.DAT", "wb+" ) ;

if ( fp == NULL )
{
puts ( "Cannot open file" ) ;
exit(0) ;
}
}

recsize = sizeof ( info ) ;

while (1)
{
        system("CLS");
        printf("\n");
/* textcolor(LIGHTGREEN); */
        printf("\n======================================");
        printf("\n");
        printf("\nBIODATA  STUDENT INFORMATION SYSTEM ");
        printf("\n");
        printf("\n======================================");
   /* normvideo(); */
printf("\n\n");
printf ( "1. ADD STUDENT RECORDS") ;
printf("\n");
printf ( "2. DISPLAY STUDENT RECORDS" ) ;
printf("\n");
printf ( "3. UPDATE STUDENT RECORDS" ) ;
printf("\n");
printf ( "4. SEARCH STUDENT RECORDS" ) ;
printf("\n");
printf ( "5. DELETE STUDENT RECORDS" ) ;
printf("\n");
printf ( "6. QUIT PROGRAM" ) ;
printf("\n\n");
printf ("SELECT YOUR CHOICE : ") ;
fflush (stdin) ;
choice = getche() ;
switch (choice)
{
case '1' :
fseek (fp, 0 ,SEEK_END) ;
another = 'Y' ;

while ( another == 'Y' )
{
system("cls");
printf("\n\n");
                    printf("=== Add New Student Record in the Database ===");
                    printf("\n\n");
printf("Enter Student ID             : ");
scanf("%s",&info.stud_id);
printf("Enter Student Name           : ");
fflush(stdin);
gets(info.name);
printf("Enter Course                 : ");
fflush(stdin);
gets(info.course);
    printf("Enter Gender M/F             : ") ;
                    info.sex = toupper(getche());
                    printf("\n");
                    printf("Enter Age                    : ") ;
                    scanf("%d",&info.age);
                    printf("Enter Home Address           : ");
                    fflush(stdin);
gets(info.address);
printf("Enter Email Address          : ");
scanf("%s",&info.email);
printf("Enter Subject                  : ");
fflush(stdin);
gets(info.subject);
printf("Enter Prelim Grade           : ");
scanf("%f",&info.prelim);
printf("Enter Midtem Grade           : ");
scanf("%f",&info.midterm);
printf("Enter Endterm Grade           : ");
scanf("%f",&info.endterm);
info.final_grade = (info.prelim * 0.20) + (info.midterm * 0.30) + (info.endterm * 0.50);
printf("\n\n");
                    printf("\nFinal Grade         : %2.0f",info.final_grade);
fwrite ( &info, recsize, 1, fp ) ;
printf("\n\n");
printf ("\nAdd another Record (Y/N) : ") ;
fflush (stdin) ;
another = toupper(getche()) ;
}

break ;

case '2' :
    system("cls");
rewind (fp);
printf("\n\n");
                printf("=== View the Records in the Database ===");
                printf("\n\n");
while ( fread ( &info, recsize, 1, fp ) == 1 )
         {
    printf("\n");
            printf("\n Student ID          : %s",info.stud_id);
        printf("\n Name                : %s",info.name);
    printf("\n Course              : %s",info.course);
    printf("\n Gender              : %c",info.sex);
    printf("\n Age                 : %d",info.age);
    printf("\n Home Address        : %s",info.address);
    printf("\n Email Address       : %s",info.email);
    printf("\n Subject             : %s",info.subject);
    printf("\n Prelim Grade        : %2.0f",info.prelim);
    printf("\n Midterm Grade       : %2.0f",info.midterm);
    printf("\n Endterm Grade       : %2.0f",info.endterm);
    printf("\n");
    info.final_grade = (info.prelim * 0.20) + (info.midterm * 0.30) + (info.endterm * 0.50);
    printf("\n Final Grade         : %2.0f",info.final_grade);
printf("\n\n");
        }
            system("pause");
            break ;

case '3' :
               rewind (fp);

another = 'Y' ;
while (another == 'Y')
{
                    system("cls");
                    printf("=== Update Student Records in the Database ===");
                    printf("\n\n");
printf("\n");
                    printf("Enter Student ID Number      : ");
scanf("%s",&student_id);
rewind (fp) ;
while (fread( &info, recsize, 1, fp ) == 1 )
{
                    if ( strcmp ( info.stud_id, student_id ) == 0 )
                    {
                        printf("Enter Student ID       : ");
                        scanf("%s",info.stud_id);
                        printf("Enter Student Name     : ");
                        fflush(stdin);
                        gets(info.name);
                        printf("Enter Course           : ");
                        fflush(stdin);
                        gets(info.course);
                        printf("Enter Gender M/F       : ") ;
                        info.sex = toupper(getche());
                        printf("\n");
                        printf("Enter Age              : ") ;
                        scanf("%d",&info.age);
                        printf("Enter Home Address     : ");
                        fflush(stdin);
                        gets(info.address);
                        printf("Enter Email Address    : ");
                        scanf("%s",&info.email);
                        printf("Enter Subject          : ");
                        fflush(stdin);
                        gets(info.subject);
                        printf("Enter Prelim Grade     : ");
                        scanf("%f",&info.prelim);
                        printf("Enter Midtem Grade     : ");
                        scanf("%f",&info.midterm);
                        printf("Enter Endterm Grade    : ");
                        scanf("%f",&info.endterm);
                        printf("\n");
                        info.final_grade = (info.prelim * 0.20) + (info.midterm * 0.30) + (info.endterm * 0.50);
                        printf("\n Final Grade         : %2.0f",info.final_grade);
                        printf("\n\n");
                        printf("Records has been updated in the database.");
                        printf("\n\n");
                        system("pause");
fseek ( fp, - recsize, SEEK_CUR ) ;
fwrite ( &info, recsize, 1, fp ) ;
break ;
                    }
                }
             if (strcmp(info.stud_id,student_id) != 0 )
                    {
                        printf("\n\n");
                        printf("No Record in the Database.");
                        printf("\n");
                        system("pause");
                        break;
                    }
                    printf("\n\n");
printf ( "\nUpdate Another Record (Y/N) : " ) ;
fflush (stdin) ;
another = toupper(getche());
}

break ;

case '4' :
                rewind (fp);

another = 'Y' ;
while ( another == 'Y' )
{
                    system("cls");
                    printf("=== Search Student Records in the Database ===");
                    printf("\n\n");
    printf("Enter Student ID       : ");
scanf("%s",&student_id);
printf("\n");
rewind (fp) ;
while ( fread( &info, recsize, 1, fp ) == 1 )
{
if (strcmp(info.stud_id,student_id) == 0 )
{
                            printf("\n");
                            printf("\n ID Number           : %s",info.stud_id);
                            printf("\n Name                : %s",info.name);
                            printf("\n Course              : %s",info.course);
                            printf("\n Gender              : %c",info.sex);
                            printf("\n Age                 : %d",info.age);
                            printf("\n Home Address        : %s",info.address);
                            printf("\n Email Address       : %s",info.email);
                            printf("\n Subject             : %s",info.subject);
                            printf("\n Prelim Grade        : %2.0f",info.prelim);
                            printf("\n Midterm Grade       : %2.0f",info.midterm);
                            printf("\n Endterm Grade       : %2.0f",info.endterm);
                            printf("\n");
                            info.final_grade = (info.prelim * 0.20) + (info.midterm * 0.30) + (info.endterm * 0.50);
                            printf("\n Final Grade         : %2.0f",info.final_grade);
                            printf("\n\n");
                            system("pause");
                            break;
                }
}

            if (strcmp(info.stud_id,student_id) != 0 )
                    {
                        printf("\n\n");
                        printf("No Record in the Database.");
                        printf("\n\n");
                        system("pause");
                        break;
                    }
                    printf("\n\n");
printf ( "\n Search Another Student Record (Y/N) : " ) ;
fflush (stdin) ;
another = toupper(getche());
}
break ;

case '5' :
another = 'Y' ;
while ( another == 'Y' )
{
system("cls");
flag=0;
                    printf("=== Delete Student Records in the Database ===");
                    printf("\n\n");
printf("Enter Student ID       : ");
scanf("%s",&student_id);
printf("\n");

    ft = fopen ("TEMP.DAT", "wb") ;
rewind (fp) ;
while (fread (&info, recsize, 1, fp) == 1 )
{
if (strcmp(info.stud_id, student_id) != 0 )
fwrite(&info, recsize, 1, ft ) ;
else
                            flag=1;
}

fclose (fp) ;
fclose (ft) ;
remove ("BIODATA.DAT") ;
rename ("TEMP.DAT", "BIODATA.DAT") ;
fp = fopen ("BIODATA.DAT", "rb+") ;

                  if(flag==1) {
                        printf("\n\n");
                        printf("Record Successfully Deleted From the Database.");
                        printf("\n\n");
                        system("pause");
                    }

else if (flag!=1) {
                        printf("\n\n");
                        printf("Sorry Record Not Found in the Database.");
                        printf("\n\n");
                        system("pause");

                    }

                        printf("\n\n");
                        printf( "Delete Another Record (Y/N) " ) ;
                        fflush ( stdin ) ;
                        another = toupper(getche());
}
break ;

case '6' :
fclose (fp) ;
printf("\n\n");
/* textcolor(YELLOW+BLINK); */
printf("             Thank You For Using This Program !!!   ");
printf("\n\n");
system("PAUSE");
exit(0);
}
}
} /* End of Code */









Saturday, August 10, 2019

CRUD Application in Visual Basic NET and MS SQL Server

Here is an example of  CRUD Application in Visual Basic NET and MS SQL Server  written by my business partner, friend and fellow software engineer Sir Larry Dave Emol. I hope you will find his work useful.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output







Heart Image Generator in C

A simple heart image generator program in C that I wrote a long time ago in my free time.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

heart.c

#include <stdio.h>
#include<conio.h>
#include <math.h>
int main()
{
int x, y, size;
printf("How big is your heart?\n");
scanf("%d", &size);
for (x=0; x<size; x++)
{
for (y=0; y<=4*size; y++)
{
double dist1 = sqrt( pow(x-size,2) + pow(y-size,2) );
double dist2 = sqrt( pow(x-size,2) + pow(y-3*size,2) );
if (dist1 < size + 0.5 || dist2 < size + 0.5 )
printf("%c",86);
else
printf(" ");
}
printf("\n");
}
for (x = 1; x <= 2*size; x++)
{
for (y=0; y<x; y++)
printf(" ");
for (y=0; y<4*size + 1 - 2*x; y++)
printf("%c",86);
printf("\n");
}
getch();
return 0;
}


Count Capital and Small Letters in C

Here is a sample program that I wrote using C programming language to count the occurrence of capital and small letters in a given sentence in C.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com




Sample Program Output


Program Listing

count.c

#include <stdio.h>
#include <stdlib.h>

char count_captial_small(char *y)
{

 int upper_case_letters = 0, lower_case_letters = 0,counter=0;
   counter = 0;
   while (y[counter] != '\0') {
      if (y[counter] >= 'A' && y[counter] <= 'Z')
         upper_case_letters++;
      if (y[counter] >= 'a' && y[counter] <= 'z')
         lower_case_letters++;
    counter++;
   }
   printf("\n\n");
   printf("\t ===== DISPLAY RESULT =====");
   printf("\n\n");
   printf("\nNumber of Uppercase Letters ===> %d.", upper_case_letters);
   printf("\nNumber of Lowercase Letters ===> %d.", lower_case_letters);
   printf("\n\n");
   printf("\t Thank you for this program.");
   printf("\n\n");
}

int main() {
   char ch[255];
   printf("\tCount Capital and Small Letters in C");
   printf("\n\n");
   printf("\nKindly enter a Word or a Sentence :=> ");
   gets(ch);
   count_captial_small(ch);
   return (0);
}




Registration System in Visual Basic 6 and Microsoft Access

Here is an example of  registration system in Visual Basic 6 and Microsoft Access written by my business partner, friend and fellow software engineer Sir Larry Dave Emol. I hope you will find his work useful.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com




Sample Program Output




Global Variable Declaration in C

Here is a sample program that will show you guys how to declare global variables in C language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Sample Program Output



Program Listing

global_variable.c

/* global_variable.c
   Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
   Date     : November 19, 2018   6:59 AM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@jakerpomperada.com
              jakerpomperada@gmail.com
              jakerpomperada@yahoo.com
              jakerpomperada@aol.com
*/


#include <stdio.h>

// Global variable declaration.
int sum=0;

int main()
{
     // Local variable declaration.
     int a=0, b=0;
    // Actual variable initialization.
    a = 5;
    b = 10;
    sum = (a + b);
    printf("\n\n");
    printf("\tGlobal Variable Declaration Program");
    printf("\n\n");
    printf("\tThe sum of %d and %d is %d.",a,b,sum);
    printf("\n\n");
    printf("\tEnd of Program");
    printf("\n\n");
   return 0;
}



Ternary Operator in C

In this article I would like to share with you guys how to use ternary operators in C language. The code is very easy to understand and use.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Sample Program Output

Program Listing

ternary.c

* ternary.c
   Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
   Date     : November 19, 2018   11:39 AM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@jakerpomperada.com
              jakerpomperada@gmail.com
              jakerpomperada@yahoo.com
              jakerpomperada@aol.com
*/

#include <stdio.h>

int main ()
{
  int a=0,b=0,c=0;
  a=10;
  b=5;
  
  c = (a>b) ? a : b;
  
  printf("\n");
  printf("\tConditional ternary operator ( ? )");
  printf("\n\n");
  printf("\tThe result is %d.",c);
  printf("\n\n");
  printf("\tEnd of Program");
  printf("\n\n");
  }