Friday, August 13, 2021

Fibonacci Series Using Controllers in AngularJS

 A simple program to ask the user to give a number and then the program will compute and display the Fibonacci series using the controller in 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 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

<!-- index.htm

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

  Date     : August 13, 2021  9:14 AM Friday

  Place    : Bacolod City, Negros Occidental

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

  Email    : jakerpomperada@gmail.com

 -->

<html>

  <head>

    <title>Fibonacci Series Using Controllers in AngularJS</title>

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

    <script>

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

    myApp.controller("Fibonacci_Series",function($scope) {

    $scope.Fibonacci_Generate=function()

    {

          

       $scope.result = "Fibonacci Series"


      var arr = [];

  

      let n1 = 0, n2 = 1, nextTerm;


    for (let i = 1; i <= $scope.a; i++) {

        arr.push(n1);

        document.getElementById("outputDiv").innerHTML = arr;

        nextTerm = n1 + n2;

        n1 = n2;

        n2 = nextTerm;

    }

        

      }


      $scope.Clear_All=function()

          {

          $scope.a = "";  

          document.getElementById("outputDiv").innerHTML = "";

          $scope.result = "";

               

      }

    

    

  });

     </script>

 </head>

 <style>

body {

font-family: arial;

font-size: 25px;

font-weight: bold;

}

</style>

 <body ng-app="myModule" ng-controller="Fibonacci_Series">

  <h3>Fibonacci Series Using Controllers in AngularJS

  </h3>

 <div>

  <table border="0">

  <tr>

  <td>

  Give a Positive Number 

  </td>

       <td>

         <input type="number" ng-model="a"/>

       </td>

      <tr>

 

      <tr>

      <td colspan="10">

      <br>

      <input type="button" ng-click="Fibonacci_Generate();"

      value="Generate Fibonacci Series"/>

           <input type="button" ng-click="Clear_All();"

           value="Clear"/>

      </td>

      </tr>

      </table>

     </div>

     

     <p> {{result}} </p> 

      

    <textarea id="outputDiv" name="outputDiv" rows="4" cols="50">


</textarea>

  

    

  </body>

</html>


Thursday, August 12, 2021

Sum of Two Numbers Using Functions in C++

Sum of Two Numbers Using Function in C++

 A simple program to ask the user to give two numbers and then the program will compute the sum of two numbers using function 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

// sum.cpp

// Jake Rodriguez Pomperada, MAED-IT, MIT

// www.jakerpomperada.blogspot.com and www.jakerpomperada.com

// jakerpomperada@gmail.com

// Bacolod City, Negros Occidental Philippines.


#include <iostream>


int addition(int a, int b);


int main()

{

int a=0,b=0,sum=0;

std::cout <<"\n\n";

std::cout << "\tSum of Two Numbers Using Function in C++";

std::cout <<"\n\n";

std::cout <<"\tGive First Value : ";

std::cin >> a;

std::cout <<"\n";

std::cout <<"\tGive Second Value : ";

std::cin >> b;

std::cout <<"\n";

sum = addition(a,b);

std::cout <<"\n";

std::cout <<"\tThe sum of " << a << " and " 

            << b << " is " << sum <<".";

  std::cout <<"\n\n\n";

  std::cout <<"\tEnd of Program";

  std::cout <<"\n";

}


int addition(int a, int b)

{

 return(a+b);

}


Switch Statement in C++

Switch Statement in C++

 A simple program to demonstrate how to declare and use switch statement 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 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

// switch.cpp

// Jake Rodriguez Pomperada, MAED-IT, MIT

// www.jakerpomperada.blogspot.com and www.jakerpomperada.com

// jakerpomperada@gmail.com

// Bacolod City, Negros Occidental Philippines.


#include <iostream>


int main()

{

int a=0;

std::cout <<"\n\n";

std::cout << "\tSwitch Statement in C++";

std::cout <<"\n\n";

std::cout <<"\tGive a Number : ";

std::cin >> a;

std::cout <<"\n";

switch(a) {

case  1 : std::cout <<"\tOne Number";

    break;

case 2 : std::cout <<"\tTwo Number";

    break;

case 3 : std::cout <<"\tThree Number";

    break;

case 4 : std::cout <<"\tFour Number";

    break;

case 5 : std::cout <<"\tFifth Number";

    break;

default : std::cout <<"\tInvalid Number. Try Again.";

      

}

  std::cout <<"\n\n\n";

  std::cout <<"\tEnd of Program";

  std::cout <<"\n";

}


C++ Mahirap Bang Pag-aralan?

Tuesday, August 10, 2021

Bubble Sort in C

Bubble Sort in C

 A simple bubble sort program that I wrote 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 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

bubble_sort.c

/* bubble_sort.c

   Author   : Mr. Jake Rodriguez Pomperada,BSCS,MAED-IT

   Tool     : Dev C++ 5.11

   Date     : April 18, 2019  Thursday   7:59 AM

   Website  : www.jakerpomperada.com and www.jakerpomperada.blogspot.com

   Email    : jake_pomperada@tup.edu.ph and jakerpomperada@gmail.com

   Location : Bacolod City, Negros Occidental

*/


#include <stdio.h>

#include <stdlib.h>

int main()

{

 int items[1000], num=0, a=0, b=0, change=0;

 system("cls");

 printf("\n\n");

 printf("\tBubble Sort Program in C");

 printf("\n\n");

 printf("\tHow many items? : ");

 scanf("%d", &num);

 printf("\n\n");

 for (a= 0; a < num; a++) {

 printf("\tEnter item no. %d: ", a+1);

scanf("%d", &items[a]);

 }

printf("\n\n");

printf("\tOriginal Arrangement of Numbers");

printf("\n\n");

 for ( a = 0 ; a < num ; a++ ) {

 printf("\t%d ", items[a]);

 }

 for (a = 0 ; a < ( num - 1 ); a++)

 {

for (b = 0 ; b < num - a - 1; b++)

{

 if (items[b] > items[b+1])

 {

change= items[b];

items[b]= items[b+1];

items[b+1] = change;

 }

}

 }

 printf("\n\n");

 printf("\tAsceding Order of Numbers");

 printf("\n\n");

 for ( a = 0 ; a < num ; a++ ) {

 printf("\t%d ", items[a]);

 }

printf("\n\n");

printf("\tEnd of Program");

printf("\n\n");

system("pause");

}



 



Radix Sort in C

Radix Sort in C

 A simple radix sort program that I wrote in C programming  thank you to my friend Tom helping me out fixing some bugs in this code.

 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

radix.c

/* radix.c

   Jake Rodriguez Pomperada,MAED-IT, MIT

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

   jakerpomperada@gmail.com

   Bacolod City, Negros Occidental */


#define  _CRT_SECURE_NO_WARNINGS // only needed for Visual Studio

#include <stdio.h>

#include <stdlib.h>


static void radixsort(int Array[], int n);

static void countingsort(int Array[], int n, int place);

static void PrintArray(int Array[], int n);



void radixsort(int Array[], int n)

{

int i = 0, place = 0;

int max = Array[0];


for (i = 1; i < n; i++) {

if (max < Array[i])

max = Array[i];

}



for (place = 1; max / place > 0; place *= 10)

countingsort(Array, n, place);

}


static void countingsort(int Array[], int n, int place) {

int i;

int* output = malloc(sizeof(int) * n);

if (output == NULL)

{

fprintf(stderr, "%s", "Out of memory");

return;

}


int freq[10] = { 0 };



for (i = 0; i < n; i++)

freq[(Array[i] / place) % 10]++;



for (i = 1; i < 10; i++)

freq[i] += freq[i - 1];



for (i = n - 1; i >= 0; i--) {

output[freq[(Array[i] / place) % 10] - 1] = Array[i];

freq[(Array[i] / place) % 10]--;

}


for (i = 0; i < n; i++)

Array[i] = output[i];


free(output);

}



static void PrintArray(int Array[], int n) {

    printf("\t");

for (int i = 0; i < n; i++)


printf("%i ", Array[i]);

printf("\n");

}



int main() {


int a = 0, num = 0;

system("cls");

printf("\n\n");

printf("\tRadix Sort Program in C");

printf("\n\n");

printf("\tHow many items? : ");

scanf("%d", &num);

printf("\n\n");

int* b = malloc(sizeof(int) * num);

if (b == NULL)

{

fprintf(stderr, "%s", "Out of memory");

return;

}

for (a = 0; a < num; a++) {

printf("\tEnter item no. %d: ", a + 1);

scanf("%d", &b[a]);

}


printf("\n\n");

printf("\tOriginal Array\n\n");

PrintArray(b, num);


radixsort(b, num);

    printf("\n\n");

printf("\tSorted Array\n\n");

PrintArray(b, num);

free(b);

return 0;

}


Monday, August 9, 2021

Grade Solver Using Functions in C++

Grade Solver Using Functions in C++

 A simple grade solver using a function that I wrote in my class in C++ programming.

 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

#include <iostream>

#include <iomanip>


using namespace std;


 float average(float prelim, float midterm, float final)

  {

      float compute=0;

      bool value;


      compute = (prelim * 0.30) +

                (midterm * 0.30) +

                (final * 0.40);


       if (compute >= 75.00) {

         value = true;

       }

       else

       {

           value = false;

       }


       switch(value) {


           case true : cout << "You Passed !!!";

                       break;

           case false : cout << "You Failed";

                       break;

       }

       cout << "\n\n";

       return(compute);

  }


  main() {

      float pre=0,mid=0,fin=0;


  cout << "\tGrade Solver Using Functions in C++";

  cout << "\n\n";

  cout << "Enter Prelim Grade :=> ";

  cin >> pre;

  cout << "Enter Midterm Grade :=> ";

  cin >> mid;

  cout << "Enter Final Grade :=> ";

  cin >> fin;

  cout << "\n\n";

  cout << fixed << setprecision(2);

  cout << "Your average grade is "

       <<average(pre,mid,fin)<<".";


  cout << "\n\n";

  system("PAUSE");

  }




Sunday, August 8, 2021

Kris Aquino's Television comeback GMA

Area of the Circle in JavaScript

Area of the Circle Using JavaScript

 A simple program to ask the user to give radius value and then the program will convert the given radius into area of the circle using JavaScript 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

index.htm

<html>
   <title>Area of the Circle in JavaScript</title>
 <style type="text/css">

 body {

  font-familyarial;
  font-weightbold;
  font-size:15px;
   }
 
 form
{
  displayinline-block;
  background-colorlightblue;
  padding6px;
}

label{
  displayblock;
  directionrtl
}

input{
  directionltr
}

label::after{
  contentattr(data-text);
}
 </style>

<script language="JavaScript">

function Solve(){

if (document.circle.radius.value === "" || document.circle.radius.value === "0" ) {
  alert("Cannot be empty. Try Again");
  document.circle.radius.focus();
else {

a = parseInt(document.circle.radius.value);

result = "The area of the circle is " + (a * a * Math.PI).toFixed(2);
document.getElementById("tag").innerHTML = result;
  }
}

function Clear() {
document.circle.radius.value ="";
document.getElementById("tag").innerHTML = "";
document.circle.radius.focus();
 }

</script>
<body>
<br>
<h3>Area of the Circle in JavaScript</h3>
<form name="circle">
<label data-text="Enter the radius of circle">&nbsp;&nbsp;
<input type="number" name="radius" autofocus required>
</label>
<br/>
<span id="tag"></span>
 <br><br>
<input type="button" value="Convert" title="Click here to solve." onclick="Solve()" />
<input type="button" value="Clear"  
title="Click here to clear the text box."
onclick="Clear()"/>
</form>
</body>
</html>


Difference of Two Numbers in JavaScript

Difference of Two Numbers in JavaScript

 A simple JavaScript program that I wrote that will ask the user to give two numbers and then it will compute the difference of the two numbers and display the result in the screen.

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

index.htm

<html>
   <title>Difference of Two Numbers in JavaScript</title>
 <style type="text/css">

 body {

  font-familyarial;
  font-weightbold;
  font-size:15px;
   }
 
 form
{
  displayinline-block;
  background-colorlightblue;
  padding6px;
}

label{
  displayblock;
  directionrtl
}

input{
  directionltr
}

label::after{
  contentattr(data-text);
}
 </style>

<script language="JavaScript">

function Solve(){

a = parseInt(document.difference.val_1.value);
b = parseInt(document.difference.val_2.value);

if (a > b) {
  result = a - b;
else {
  result = b - a;
}
document.difference.diff.value = (result);
}

function Clear() {
document.difference.val_1.value ="";
document.difference.val_2.value="";
document.difference.diff.value="";
document.difference.val_1.focus();
 }

</script>
<body>
<br>
<h3>Difference of Two Numbers in JavaScript</h3>
<form name="difference">
<label data-text="First Value">&nbsp;&nbsp; 
<input type="text" name="val_1" autofocus required>
</label>
<br />
<label data-text="Second Value">&nbsp;&nbsp;
<input type="text" name="val_2"required="">
</label>
<br/>
<label data-text="Difference">&nbsp;&nbsp;<input type="text" name="diff" >
</label>
<br /> <br>
<input type="button" value="Convert" title="Click here to solve." onclick="Solve()" />
<input type="button" value="Clear"  
title="Click here to clear the text box."
onclick="Clear()"/>
</form>
</body>
</html>