Friday, June 11, 2021

Count Vowels in PHP

 A simple program to count the vowels, occurrence of vowels in a given string in PHP 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 at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.







Program Listings

index.php

<html>

  <head> 

   <title> Count Vowels in PHP </title>

  </head>

  <body> 

      <style type="text/css">

      

      body {

        font-family: arial;

            size: 12px;

      };


        </style>

    <?php


     error_reporting(0);



     $val_str = strtolower($_POST['val_str']);

     

      

   if(isset($_POST['submit'])) {

      

      $results = "<h4>The Number of Vowels : &nbsp;" 

        .count_Vowels($val_str)."</h4>";

      

      $display_strings =  "<h4>The List of Vowels : " 

        .strip_Consonants($val_str)."</h4>";


      $display_vowels = "<h4>Number of Letter A : " 

                         .count_a($val_str)."</h4>";

      $display_vowels .= "<h4>Number of Letter E : " 

                       .count_e($val_str)."</h4>";

      $display_vowels .= "<h4>Number of Letter I : " 

                         .count_i($val_str)."</h4>";

      $display_vowels .= "<h4>Number of Letter O : " 

                       .count_o($val_str)."</h4>";

      $display_vowels .= "<h4>Number of Letter U : " 

                       .count_u($val_str)."</h4>";

      

      }




 if(isset($_POST['clear'])) {

      $val_str = "";

      $results = "";

      $display_strings = "";

    }



function count_Vowels($string)

{

    preg_match_all('/[aeiou]/i', $string, $matches);

    return count($matches[0]);

}

 

function strip_Consonants($string)

{


  $trans = array("b" => "","c"=>"","d"=>"","f"=>"","g"=>"",

                 "h" => "","j"=>"","k"=>"","l"=>"","m"=>"",

                 "n" => "","p"=>"","q"=>"","r"=>"","s"=>"",

                 "t" => "","v"=>"","x"=>"","z"=>"");

  

  return  strtoupper(strtr($string, $trans));

}


function count_a($string)

{


  preg_match_all('/[a]/i', $string, $matches);

  return count($matches[0]);

}


function count_e($string)

{


  preg_match_all('/[e]/i', $string, $matches);

  return count($matches[0]);

}


function count_i($string)

{


  preg_match_all('/[i]/i', $string, $matches);

  return count($matches[0]);

}


function count_o($string)

{


  preg_match_all('/[o]/i', $string, $matches);

  return count($matches[0]);

}


function count_u($string)

{


  preg_match_all('/[u]/i', $string, $matches);

  return count($matches[0]);

}



?>


  <h2> Count Vowels in PHP </h2>

  <p> Mr. Jake Rodriguez Pomperada,MAED-IT, MIT </p>

<form method="post">

   <p>Give a String <input 

    type="text" name="val_str" size=50

     value="<?php echo $val_str; ?>" autofocus required /></p>

      

<input type="submit" name="submit" 

   title="Click here to count the vowels."

   value="Submit" />

   

    &nbsp;&nbsp;&nbsp;

    <input type="submit" name="clear" 

    title="Click here to clear the textbox."

    value="Clear" />

</form>


<?php

   echo $results;

   echo $display_strings;

   echo $display_vowels;

?>

</body>

</html>



Wednesday, June 9, 2021

Password Security in C

Password Security in C

 A simple password security program that I wrote 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 at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.






Program Listing

password.c


/* password.c

   Prof. Jake Rodriguez Pomperada,MAED-IT, MIT

   www.jakerpomperada.com

   www.jakerpomperada.blogspot.com

   jakerpomperada@gmail.com

   Bacolod City, Negros Occidental

*/


#include <stdio.h>

#include <string.h>

#include <conio.h>


int main()

{

    char buffer[256] = {0};

    char password[] = "admin";

    char c;

    int pos = 0;


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

    printf("\nPassword Security in C");

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

    printf("\n\n");


     printf("%s", "Give Your Password: ");

    do {

        c = getch();


        if( isprint(c) )

        {

            buffer[ pos++ ] = c;

            printf("%c", '*');

        }

        else if( c == 8 && pos )

        {

            buffer[ pos-- ] = '\0';

            printf("%s", "\b \b");

        }

    } while( c != 13 );


    if( !strcmp(buffer, password) )


    {

        printf("\n\n");

        printf("Password is Accepted.");

        printf("\n\n");

    }

    else

         {

        printf("\n\n");

        printf("Intruder has been detected.");

        printf("\n\n");

    }

        printf("\n\n");

        printf("THANK YOU FOR USING THIS PROGRAM");

        printf("\n\n");

}



Monday, June 7, 2021

Local Variables in Python

Local Variables in Python

 Here is a sample program to demonstrate how to declare and use local variables in Python 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 at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.





Program Listing

# local_variables.py
# Prof. Jake R. Pomperada, MAED-IT, MIT
# June 7, 2021
# Bacolod City, Negros Occidental

def sum(a, b,c):
print()
print("\tLocal Variables in Python")
sum = a + b + c
print()
print("\tThe sum of {0},{1} and {2} is {3}.".format(a,b,c,sum))

sum(1,2,3)

Friday, June 4, 2021

Average Grade Using Do While Loop in C++

Average Grade Solver Using Do While Loop in C++

  Machine Problem

Write a program that will ask the user to give a grade and then the program will compute the average grade using while loop statement 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 at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.






Program Listing


/* average_grade_do_while_loop.cpp

   Jake Rodriguez Pomperada,MAED-IT,MIT

   www.jakerpomperada.com www.jakerpomperada.blogspot.com

   jakerpomperada@gmail.com

   Bacolod City, Negros Occidental Philippines

*/


#include <iostream>

#include <cmath>


using namespace std;


int main()

{

int NumGrades=0;

double grades=0.00;

double total=0.00,GradeAv=0.00;

cout <<"\n\n";

    cout <<"\tAverage Grade Solver Using Do While Loop in C++";

    cout <<"\n\n";

    

do {

cout << "\tEnter the Grade No. " << (NumGrades+1)

<< ".  (Press -1 To Stop ) : ";

cin >> grades;

total += grades;

if (grades == -1) {

GradeAv = ceil((total / NumGrades));

cout << "\n\n\tThe average of Grade is " << 

     GradeAv<< ".";

break;

}

NumGrades++;

     }  while(NumGrades != -1);

      cout <<"\n\n";

  cout <<"\tEnd of Program";

  cout <<"\n";

}


Average Grade Using While Loop in C++

Average Grade Solver Using While Loop in C++

 Machine Problem

Write a program that will ask the user to give a grade and then the program will compute the average grade using while loop statement 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 at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.








Program Listing

/* average_grade_while_loop.cpp
   Jake Rodriguez Pomperada,MAED-IT,MIT
   www.jakerpomperada.com www.jakerpomperada.blogspot.com
   jakerpomperada@gmail.com
   Bacolod City, Negros Occidental Philippines
*/

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
int NumGrades=0;
double grades=0.00;
double total=0.00,GradeAv=0.00;
cout <<"\n\n";
    cout <<"\tAverage Grade Solver Using While Loop in C++";
    cout <<"\n\n";
     while(NumGrades != -1)
{
cout << "\tEnter the Grade No. " << (NumGrades+1)
<< ".  (Press -1 To Stop ) : ";
cin >> grades;
total += grades;
if (grades == -1) {
GradeAv = ceil((total / NumGrades));
cout << "\n\n\tThe average of Grade is " << 
     GradeAv<< ".";
break;
}
NumGrades++;
     }
      cout <<"\n\n";
  cout <<"\tEnd of Program";
  cout <<"\n";
}

Wednesday, June 2, 2021

Average Grade Using For Loop in C++

Average Grade Solver Using For Loop in C++

Machine Problem

Write a program that will ask the user to give a grade and then the program will compute the average grade using for loop statement 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 at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.






Program Listing

/* average_grade_for_loop.cpp

   Jake Rodriguez Pomperada,MAED-IT,MIT

   www.jakerpomperada.com www.jakerpomperada.blogspot.com

   jakerpomperada@gmail.com

   Bacolod City, Negros Occidental Philippines

*/


#include <iostream>

#include <cmath>


using namespace std;


int main()

{

int NumGrades=0;

double grades=0.00;

double total=0.00,GradeAv=0.00;

cout <<"\n\n";

    cout <<"\tAverage Grade Solver Using For Loop in C++";

    cout <<"\n\n";

for (NumGrades = 0;; NumGrades++)

{

cout << "\tEnter the Grade No. " << (NumGrades+1) 

<< ".  (Press -1 To Stop ) : ";

cin >> grades;

total += grades;

if (grades == -1) {

GradeAv = ceil((total / NumGrades));

cout << "\n\n\tThe average of Grade is " << 

     GradeAv<< ".";

break;

}

     }

      cout <<"\n\n";

  cout <<"\tEnd of Program";

  cout <<"\n";

}


Tuesday, June 1, 2021

Odd and Even Numbers in Visual Basic 6

Odd and Even Numbers in Visual Basic 6

 A simple program to ask the user to give a number and then the program will check if the given number is odd or even using Microsoft Visual Basic 6 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 at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.









Program Listing

' Odd and Even Numbers in Visual Basic 6

' Jake Rodriguez Pomperada, MAED-IT, MIT

' www.jakerpomperada.blogspot.com  www.jakerpomprada.com

' jakerpompeada@gmail.com

' Bacolod City, Negros Occidental Philippines

' May 31, 2021


Private Sub cmdCheck_Click()

x = Val(Form1.txtVal.Text)

If ((x Mod 2) = 0) Then

  Label2.Caption = "The given number " & x & " is an even number."

Else

  Label2.Caption = "The given number " & x & " is an odd number."

End If

End Sub


Private Sub cmdClear_Click()

Form1.txtVal.Text = ""

Label2.Caption = ""

Form1.txtVal.SetFocus

End Sub


Private Sub cmdQuit_Click()

answer = MsgBox("Do you want to quit?", vbQuestion + vbYesNo, "Confirm")

If answer = vbYes Then

End

Else

MsgBox "Action canceled", vbInformation, "Confirm"

Form1.txtVal.Text = ""

Label2.Caption = ""

Form1.txtVal.SetFocus

End If

End Sub


Private Sub Form_Load()

' Center the form on the screen

 Me.Move (Screen.Width - Me.Width) / 2, _

     (Screen.Height - Me.Height) / 2


End Sub



Monday, May 31, 2021

Prime Number in C++

Prime Number in C++

 Machine Problem 

A number which is only divisible by itself and 1 is known as prime number,  for example: 7 is a prime number because it is only divisible by itself and 1.

Write a program to ask the user to give a number and then the problem will check and determine if the given number is a prime number or not.

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 at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.








Program Listing

prime_number.cpp

// prime_number.cpp
//
// Machine Problem
//
// A number which is only divisible by itself and 1 is known as prime number, 
// for example: 7 is a prime number because it is only divisible by itself and 1.
//
// Write a program to ask the user to give a number and then the program will
// check and determine if the given number is a prime number or not.
// 
//  Jake Rodriguez Pomperada, MAED-IT, MIT
//  www.jakerpomperada.com   www.jakerpomperada.blogspot.com
// jakerpomperada@gmail.com
// Bacolod City, Negros Occidental Philippines.

#include <iostream>

int num_val=0,i=0;

bool flag = true;
   

int main(){
   
   std::cout << "\n\n";
   std::cout << "\tPrime Number in C++";
   std::cout << "\n\n";
   std::cout<<"\tGive a Number (Positive Number Only) : ";
   std::cin>>num_val;

   std::cout << "\n";
     
   for(i = 2; i <= num_val / 2; i++) {
      if(num_val % i == 0) {
         flag = false;
         break;
      }
   }
   
   if (flag==true) {
         std::cout<<"\tThe given number "<<num_val<<" is a prime number.";
       }
   else {
      std::cout<<"\tThe given number "<<num_val<<" is not a prime number.";
    }
   std::cout <<"\n\n";
   std::cout <<"\tEnd of Program\n";
 }



Saturday, May 29, 2021

Hello World in Scala

Hello World in Scala

 Here is a simple hello world program in Scala 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 at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.






Program Listing

HelloWorld.scala

// HelloWorld.scala
// Jake Rodriguez Pomperada,MAED-IT, MIT
// www.jakerpomperada.com  www.jakerpomperada.blogspot.com
// jakerpomperada@gmail.com
// Bacolod City, Negros Occidental Philippines

object HelloWorld {
    def main(args: Array[String]): Unit = {
        println("Hello, World in Scala !!!");
         
    }
}


Leap Year Checker in Scala

Leap Year Checker in Scala

 A simple Scala program to ask the user to give a year and then the program will check if the given year is a leap year or not using Scala 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 at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.







Program Listing

leap_year.scala

// leap_year.scala
// Jake Rodriguez Pomperada,MAED-IT, MIT
// www.jakerpomperada.com  www.jakerpomperada.blogspot.com
// jakerpomperada@gmail.com
// Bacolod City, Negros Occidental Philippines

import java.util.Scanner;

object leap_year {
 
 def main(args: Array[String]):Unit={
 
  var scanner = new Scanner(System.in);

val isLeapYear = (year: Int) => (((year % 4) == 0) && !(
  ((year % 100) == 0) &&
  !((year % 400) == 0))
)
  println();
  print("\tLeap Year Checker in Scala");
  println("\n");
  
  print("Give a Year : ");
  var year = scanner.nextInt();
 
println("\n");

 if (isLeapYear(year)) {
     println(s"The given year $year is a Leap Year.");
 } else {
     println(s"The given year $year is Not a Leap Year.");
 }

  println();
  println("END OF PROGRAM");
  println();
 }
}

Odd and Even Numbers in Scala

Odd and Even Numbers in Scala

 A simple program to ask the user to give a number and then the program will check if the given number is odd or even using Scala 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 at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.






Program Listing


odd_even.scala


// odd_even.scala
// Jake Rodriguez Pomperada,MAED-IT, MIT
// www.jakerpomperada.com  www.jakerpomperada.blogspot.com
// jakerpomperada@gmail.com
// Bacolod City, Negros Occidental Philippines

import java.util.Scanner;

object odd_even {
 
 def main(args: Array[String]):Unit={
 
  var scanner = new Scanner(System.in);

  // These functions test for even and odd numbers.
def isEven(number: Int) = number % 2 == 0
def isOdd(number: Int) = !isEven(number)


  println();
  print("\tOdd and Even Numbers in Scala");
  println("\n");
  
  print("Give a number : ");
  var a = scanner.nextInt();
 
println("\n");

 if (isEven(a)) {
     println(s"The given number $a is even number.");
 } else {
     println(s"The given number $a is odd number.");
 }

  println();
  println("END OF PROGRAM");
  println();
 }
}

Friday, May 28, 2021

Addition of Two Numbers in Scala

Addition of Two Numbers in Scala

 A simple program to ask the user to give two numbers and then the program will compute the sum of two numbers using Scala 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 at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.








Program Listing


Addition.scala

import java.util.Scanner;

object Addition {
 
 def main(args: Array[String]):Unit={
 
  var scanner = new Scanner(System.in);
  
  println();
  print("Addition of Two Numbers in Scala");
  println("\n");
  
  print("Enter the first number : ");
  var a = scanner.nextInt();
 
  print("Enter the second number : ");
  var b = scanner.nextInt();
  println();

  var sum = a+b;

  println(s"$a + $b = $sum");
  println();
  println("END OF PROGRAM");
  println();
 }
}