Monday, November 1, 2021

Employee's Contact Details System in C

 A simple employees contact details system in C programming 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 at 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.





Program Listing

/*employees_details.c

 Authors   : Jake R. Pomperada,MAED-IT, MIT

 Emails    : jakerpomperada@gmail.com 

 Tool      : Dev C++ Version 5.11

 Date     :  November 1, 2021  Monday  9:53 AM

 */


#include <stdio.h>

#include <stdlib.h>

#include <conio.h>

#include <ctype.h>

#include <string.h>


main( )

{

FILE  *fp, *ft ;

char  another, choice ;

struct employees

{

char  emp_id[200];

char  name[200];

char  sex;

char  address[200];

char  telephone[200];

char  mobile[200];

char  email[200];

};


struct employees info ;

char employee_id[200];

int flag=0;


long int  recsize ;

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


if ( fp == NULL )

{

fp = fopen ("RECORDS.DAT", "wb+" ) ;


if ( fp == NULL )

{

puts ("Cannot open file" ) ;

exit(0) ;

}

}


recsize = sizeof ( info ) ;


while (1)

{

        system("CLS");

        printf("\n");

        printf("\n\t===========================================");

        printf("\n\tEMPLOYEES CONTACT DETAILS SYSTEM IN C ");

        printf("\n\t\t\tCreated By");

        printf("\n\t   Jake R. Pomperada, MAED-IT, MIT");

        printf("\n\t===========================================");

printf("\n\n");

printf ( "\t1. ADD EMPLOYEE'S RECORD") ;

printf("\n");

printf ( "\t2. DISPLAY EMPLOYEE'S RECORD" ) ;

printf("\n");

printf ( "\t3. UPDATE EMPLOYEE'S RECORD" ) ;

printf("\n");

printf ( "\t4. SEARCH EMPLOYEE'S RECORD" ) ;

printf("\n");

printf ( "\t5. DELETE EMPLOYEE'S RECORD" ) ;

printf("\n");

printf ( "\t6. QUIT PROGRAM" );

printf("\n\n\n");

printf ("\tSELECT 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("\t=== Add New Employee's Record in the Database ===");

                    printf("\n\n");

printf("\tEnter Employees ID Number    : ");

scanf("%s",&info.emp_id);

printf("\tEnter Employee's Name        : ");

fflush(stdin);

gets(info.name);

printf("\tEnter Gender M/F             : ") ;

                    info.sex = toupper(getche());

                    printf("\n");

                    printf("\tEnter Home Address           : ");

                    fflush(stdin);

gets(info.address);

printf("\tEnter Telephone Number       : ");

                    fflush(stdin);

gets(info.telephone);

printf("\tEnter Mobile Number          : ");

                    fflush(stdin);

gets(info.mobile);

printf("\tEnter Email Address          : ");

fflush(stdin);

gets(info.email);

    fwrite (&info, recsize, 1, fp ) ;

printf("\n\n");

printf ("\n\tAdd another Record (Y/N)  : ") ;

fflush (stdin) ;

another = toupper(getche()) ;

}


break ;


case '2' :

    system("cls");

rewind (fp);

printf("\n\n");

                printf("\t=== View Employee's Records in the Database ===");

                printf("\n");

while ( fread ( &info, recsize, 1, fp ) == 1 )

         {

    printf("\n\tEmployee's ID Number  : %s",info.emp_id);

        printf("\n\tEmployee's Name       : %s",info.name);

    printf("\n\tGender                : %c",info.sex);

    printf("\n\tHome Address          : %s",info.address);

    printf("\n\tTelephone Number      : %s",info.telephone);

    printf("\n\tMobile Number         : %s",info.mobile);

    printf("\n\tEmail Address         : %s",info.email);

        printf("\n\n");

        }

            system("pause");

            break ;


case '3' :

               rewind (fp);

another = 'Y' ;

while (another == 'Y')

{

                    system("cls");

                    printf("\n\n");

                    printf("\t=== Update Employee's Records in the Database ===");

                    printf("\n\n");

    printf("\tEnter Employee's ID Number    : ");

scanf("%s",&employee_id);

printf("\n");

rewind (fp) ; 

while (fread( &info, recsize, 1, fp ) == 1 )

{

                    if ( strcmp (info.emp_id, employee_id ) == 0 )

                    {

                    printf("\tEnter Employee's ID Number    : ");

scanf("%s",&info.emp_id);

printf("\tEnter Employee's Name         : ");

fflush(stdin);

gets(info.name);

printf("\tEnter Gender M/F              : ") ;

                    info.sex = toupper(getche());

                    printf("\n");

                    printf("\tEnter Home Address            : ");

                    fflush(stdin);

gets(info.address);

printf("\tEnter Telephone Number        : ");

                    fflush(stdin);

gets(info.telephone);

printf("\tEnter Mobile Number           : ");

                    fflush(stdin);

gets(info.mobile);

printf("\tEnter Email Address           : ");

fflush(stdin);

gets(info.email);

                    printf("\n\n");

                    printf("\tEmployee's 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.emp_id,employee_id) != 0 )

                    {

                        printf("\n\n");

                        printf("\tNo Record in the Database.");

                        printf("\n");

                        system("pause");

                        break;

                    }

                    printf("\n\n");

printf ("\n\tUpdate Another Record (Y/N) : " ) ;

fflush (stdin) ;

another = toupper(getche());

}

break ;

case '4' :

                rewind (fp);

another = 'Y' ;

while ( another == 'Y' )

{

                  system("cls");

printf("\n\n");

                    printf("\t=== Search Employee's Records in the Database ===");

                    printf("\n\n");

    printf("\tEnter Employee's ID Number     : ");

scanf("%s",&employee_id);

    rewind (fp) ;

    printf("\n");

while (fread( &info, recsize, 1, fp ) == 1 )

{

if (strcmp(info.emp_id,employee_id) == 0 )

{

                        printf("\n\tEmployee's ID Number  : %s",info.emp_id);

        printf("\n\tEmployee's Name       : %s",info.name);

        printf("\n\tGender                : %c",info.sex);

        printf("\n\tHome Address          : %s",info.address);

    printf("\n\tTelephone Number      : %s",info.telephone);

    printf("\n\tMobile Number         : %s",info.mobile);

    printf("\n\tEmail Address         : %s",info.email);

                        printf("\n\n");

                        system("pause");

                        break;

                }

}


            if (strcmp(info.emp_id,employee_id) != 0 )

                    {

                        printf("\n");

                        printf("\tSorry No Record Found in the Database.");

                        printf("\n\n");

                        system("pause");

                        break;

                    }

                    printf("\n");

printf ("\n\tSearch Another Employee's Record? (Y/N) : " ) ;

fflush (stdin) ;

another = toupper(getche());

}

break ;


case '5' :

another = 'Y' ;

while ( another == 'Y' )

{

system("cls");

flag=0; 

printf("\n\n");

                    printf("\t=== Delete Employee's Records in the Database ===");

                    printf("\n\n");

printf("\tEnter Employee's ID Number      : ");

scanf("%s",&employee_id);

printf("\n");

    ft = fopen ("TEMP.DAT", "wb") ;

rewind (fp) ;

while (fread (&info, recsize, 1, fp) == 1 )

{

if (strcmp(info.emp_id, employee_id) != 0 )

fwrite(&info, recsize, 1, ft ) ;

else

                            flag=1;

}

fclose (fp) ;

fclose (ft) ;

remove ("RECORDS.DAT") ;

rename ("TEMP.DAT", "RECORDS.DAT") ;

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

                  if(flag==1) {

                        printf("\n\n");

                        printf("\tRecord Successfully Deleted From the Database.");

                        printf("\n\n");

                        system("pause");

                    }

else if (flag!=1) {

                        printf("\n\n");

                        printf("\tSorry Record Not Found in the Database.");

                        printf("\n\n");

                        system("pause");

                    }

                        printf("\n\n");

                        printf( "\tDelete Another Employee's Record? (Y/N) " ) ;

                        fflush ( stdin ) ;

                        another = toupper(getche());

}

break ;

case '6' :

fclose (fp) ;

printf("\n\n");

printf("\t\tThank You For Using This Program !!!   ");

printf("\n\n");

system("PAUSE");

exit(0);

}

}

} /* End of the Code */

Sunday, October 31, 2021

Uppercase Consonants in C#

Uppercase Consonants in C#

 A simple program that will ask the user to give a string and then the program will uppercase the consonants in a given string using C# programming 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 at 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.





Program Listing

Program.cs

using System;


public class Program

{

  public static void Main()

  {

    Console.Write("\n");

    Console.Write("\tUppercase Consonants in C#");

    Console.Write("\n\n");

    Console.Write("\tEnter a string: ");

    string input = Console.ReadLine();


    Console.Write("\n\n");

    Console.Write("\tGiven String : " + input);

    Console.Write("\n\n");

    Console.Write("\tThe Result: ");

    foreach (char ch in input)

    {

      PrintChar(ch);

    }


    Console.Write("\n\n");

    Console.Write("\tEnd of Program");

    Console.Write("\n");

    Console.ReadKey();

  }

     

  public static void PrintChar(char ch)

  {

    ConsoleColor old_color = Console.ForegroundColor;


    if (ch.IsConsonant())

    {


      Console.ForegroundColor = ConsoleColor.Yellow;

      Console.Write(Char.ToUpper(ch));

      Console.ForegroundColor = old_color;

    }

    else

      Console.Write(ch);

  }

}



Characterextensions.cs

using System; public static class CharacterExtensions { public static bool IsConsonant(this char ch) { const string consonants = "BCDFGHJKLMNPQRSTVWXYZ"; return consonants.IndexOf(Char.ToUpper(ch)) != -1; } }


Saturday, October 30, 2021

Introduction To Go (Golang) Programming

US Dollar To Philippine Peso in Python

US Dollar To Philippine Peso in Python

 Machine Problem

Write a program that will ask the user to give US Dollar money value and then it will convert 
it into Philippine Peso equivalent.
  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 at 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.




Program Listing


# USDollar_PhilippinePeso.py
# Prof. Jake Rodriguez Pomperada, MAED-IT, MIT
# www.jakerpomperada.blogspot.com and www.jakerpomperada.com
# jakerpomperada@gmail.com
#
# Write a program that will ask the user to give US Dollar money
# value and then it will convert it into Philippine Peso equivalent.

print()
print("\tUS Dollar To Philippine Peso in Python")
print()
us_dollar = float(input('Enter US Dollar Value : '))

phil_peso = us_dollar * 50.531


print()
print("$ %0.2f US Dollar\'s is equivalent to PHP %0.2f peso\'s" %(us_dollar,phil_peso))
print()
print("\tEnd of Program")
print()

Addition and Difference of Two Numbers Using C#

Addition and Difference of Two Numbers in C#

 A simple program that will ask the user to give two numbers and then the program will compute the sum and difference of two numbers using C# programming 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 at 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.





Program Listing

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a=0,b=0;
            Console.WriteLine();
            Console.WriteLine("\tAddition and Difference of Two Numbers in C#");
            Console.WriteLine();
            Console.Write("\tEnter First Value  : ");
            a = Convert.ToInt32(Console.ReadLine());
            Console.Write("\tEnter Second Value : ");
            b = Convert.ToInt32(Console.ReadLine());
            int Addition=0, Difference=0;

            Addition = (a+b);
            Difference = (a-b);

            Console.WriteLine();
            Console.WriteLine("\tThe sum of " + a.ToString() + " and "
                + b.ToString() + " is " + Addition.ToString() + ".");
            Console.WriteLine();
            Console.WriteLine("\tThe difference  " + a.ToString() + " and "
                       + b.ToString() + " is " + Difference.ToString() + ".");
            Console.WriteLine("\n");
            Console.WriteLine("\tEnd of Program");
            Console.ReadLine();  
        }
    }
}


Friday, October 29, 2021

Leap Year in Visual Basic 6

Leap Year in Visual Basic 6

 A simple program that will ask the user to give a year and then the program will check if the year given is leap year or not using Visual Basic 6.

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






Program Listing

Private Sub Command1_Click()

y = Val(Text1.Text)


If y Mod 4 = 0 Then


MsgBox ("The given year " & y & " is a Leap year.")


Else


MsgBox ("The given year " & y & " is NOT a Leap year.")


 End If


End Sub


Private Sub Command2_Click()

Text1.Text = ""

Text1.SetFocus

End Sub


Private Sub Command3_Click()

End

End Sub


Thursday, October 28, 2021

Multiply Two Numbers Using ng app in AngularJS

Multiply Two Numbers Using ng-app in AngularJS

 Machine Problem

Write a program that uses ng-app directive that will multiply the  values of two numbers and display the results on the screen using AngularJS.

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





Program Listing

<!-- index.htm

  Author   : Prof. Jake Rodriguez Pomperada, MAED-IT, MIT

  Date     : July 25, 2021  Sunday  10:07 PM

  Place    : Bacolod City, Negros Occidental

  Websites : www.jakerpomperada.com and www.jakerpomperada.blogspot.com

  Email    : jakerpomperada@gmail.com

 -->

<html>

<head> 

<title>Multiply Two Numbers Using ng-app in AngularJS</title>

</head>

<style>

body {

   font-family: "arial";

   font-style: bold;

   font-size: 18px;

  }

 </style>

<script type="text/javascript" src="angular.min.js"></script>

<body><br>

<h3>Multiply Two Numbers Using ng-app in AngularJS</h3>

<body>

<div ng-app="myApp" ng-controller="Multiply_Controller">

The product of {{A}} and {{B}} is {{A*B}}.

</div>

<script>

var app = angular.module("myApp", []);

app.controller("Multiply_Controller", function($scope) {

    $scope.A = 5;

    $scope.B = 6;

});

</script>

</body>

</html>

</body>

</html>