Sunday, August 22, 2021

Largest of Three Numbers in AngularJS

 Machine Problem

Write a program that will ask user to give three numbers, and then the program will find the largest of three given numbers by the user and then display the results 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

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

  Date     : July 23, 2021  Friday  10:54 PM

  Place    : Bacolod City, Negros Occidental

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

  Email    : jakerpomperada@gmail.com

 -->

<html>

  <head>

    <title>Largest of Three Numbers in AngularJS</title>

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

    <script>

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

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

    $scope.doFind=function()

    {

      var max_val = 0;

        if ($scope.a > $scope.b)

      {

      max_val = $scope.a;

    } else

    {

     max_val = $scope.b;

    }

    if ($scope.c > max_val) 

    {

     max_val = $scope.c;

    }

      $scope.result = "The Largest Number is " + max_val + ".";

  }

    

  });

     </script>

 </head>

 <style>

body {

font-family: arial;

font-size: 25px;

font-weight: bold;

}

</style>

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

  <h3>Largest of Three Numbers in AngularJS</h3>

 <div>

  <table border="0">

  <tr>

  <td>

  Enter Your First Number

  </td>

       <td>

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

       </td>

      <tr>

  <td>

  Enter Your Second Number

  </td>

       <td>

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

       </td>   

       </tr>

       <tr>

      <td>

      Enter Your Third Number

     </td>

       <td>

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

       </td>   

       </tr>

      <tr>

      <td colspan="10">

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

      value="Find Largest Number"/>

      </td>

      </tr>

      </table>

     </div><br>

       {{result}}

    </div>

  </body>

</html>


Saturday, August 21, 2021

Area of the Circle in VB NET

Area of the Circle in VB.NET

 Machine Problem

Write a program that will ask the user to give a radius of a circle and the program will compute

the area of the circle.

Use the following formula below.

area = (3.14 * radius * radius)

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


' Area of the Rectangle in VB.NET

' Prof. Jake Rodriguez Pomperada, MAED-IT, MIT

' www.jakerpomperada.com  and www.jakerpomperada.blogspot.com

' jakerpomperada@gmail.com

' Bacolod City, Negros Occidental Philippines

' May 16, 2021   Sunday  1:10 PM


Public Class Form1

    'Declaring constant value of PI of the circle

    Public Const PI = 3.14


    ' Compute Button

    Private Sub btnCompute_Click(sender As Object, e As EventArgs) Handles btnCompute.Click

        Dim radius As Single = 0.0F

        Dim area As Single = 0.0F

        Dim radius_value As String


        radius_value = txtRadius.Text


        If radius_value = "" Or IsNumeric(radius_value) = False Then

            MessageBox.Show("Please enter a radius value.")

            txtRadius.Focus()

        Else

            area = PI * Val(radius_value) * Val(radius_value)

            txtArea.Text = area.ToString("#####.##")

            txtArea.ReadOnly = True

        End If


    End Sub

    ' Clear Button

    Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click

        txtRadius.Text = ""

        txtArea.Text = ""

        txtRadius.Focus()

    End Sub


    Private Sub btnQuit_Click(sender As Object, e As EventArgs) Handles btnQuit.Click

        Dim result = MessageBox.Show(" Are you sure you want to quit the program?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question)

        If result = DialogResult.Yes Then

            Me.Close()

        Else

            Me.Show()

            txtRadius.Text = ""

            txtArea.Text = ""

            txtRadius.Focus()

        End If

    End Sub

End Class


Friday, August 20, 2021

Addition of Three Numbers in VB NET

Addition of Three Numbers in VB.NET

 Machine Problem


Write a program that will ask the user to gived three numbers, and compute the sum of that numbers.

Use the following formula below.

total_sum = (variable_one + variable_two +variable_three)

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 of Three Numbers Using VB.NET

' Prof. Jake Rodriguez Pomperada, MAED-IT, MIT

' www.jakerpomperada.com  and www.jakerpomperada.blogspot.com

' jakerpomperada@gmail.com

' Bacolod City, Negros Occidental Philippines

' May 16, 2021   Sunday  11:23 AM


Public Class Form1

    ' Button Compute

    Private Sub btnCompute_Click(sender As Object, e As EventArgs) Handles btnCompute.Click

        Dim sum As Integer

        Dim a, b, c As String


        sum = 0


        a = txtValue1.Text

        b = txtValue2.Text

        c = txtValue3.Text


        If a = "" Or IsNumeric(a) = False Then

            MessageBox.Show("Please enter a numeric value.")

            txtValue1.Focus()

        ElseIf b = "" Or IsNumeric(b) = False Then

            MessageBox.Show("Please enter a numeric value.")

            txtValue2.Focus()

        ElseIf c = "" Or IsNumeric(c) = False Then

            MessageBox.Show("Please enter a numeric value.")

            txtValue3.Focus()

        Else

            sum = Val(a) + Val(b) + Val(c)

            MessageBox.Show("The sum of " & a & "," & b & ", and " & c & " is " & sum & ".", "The Result")

        End If

    End Sub


    'Button Quit

    Private Sub btnQuit_Click(sender As Object, e As EventArgs) Handles btnQuit.Click

        Dim result = MessageBox.Show(" Are you sure you want to quit the program?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question)

        If result = DialogResult.Yes Then

            Me.Close()

        Else

            Me.Show()

            txtValue1.Text = ""

            txtValue2.Text = ""

            txtValue3.Text = ""

            txtValue1.Focus()

        End If

    End Sub

    

    'Button Clear

    Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click

        txtValue1.Text = ""

        txtValue2.Text = ""

        txtValue3.Text = ""

        txtValue1.Focus()

    End Sub

End Class


Swapping Two Numbers Using AngularJS

Swapping of Two Numbers in AngularJS

 Machine Problem

Write a program that will ask user to give two numbers and then the  program will display the original and swap arrangement of the two numbers given by the user.

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     : July 23, 2021  Friday  10:26 PM

  Place    : Bacolod City, Negros Occidental

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

  Email    : jakerpomperada@gmail.com

 -->

<html>

  <head>

    <title>Swapping of Two Numbers in AngularJS </title>

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

    <script>

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

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

    $scope.doSwap=function()

    {

              $scope.after_swap="Swap Arrangement    : " 

             + $scope.a + " and " + $scope.b;


             var temp = $scope.a;

             $scope.a = $scope.b;

             $scope.b = temp;

            

             $scope.before_swap="Original Arrangement : " 

             + $scope.a + " and  " + $scope.b;

    }


    });

     </script>

 </head>

 <style>

body {

font-family: arial;

font-size: 25px;

font-weight: bold;

}

</style>

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

  <h3>Swapping of Two Numbers in AngularJS </h3>

 <div>

  <table border="0">

  <tr>

  <td>

  Enter Your First Number

  </td>

       <td>

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

       </td>

      <tr>

  <td>

  Enter Your Second Number

  </td>

       <td>

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

       </td>   

       </tr>

      <tr>

      <td colspan="10">

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

      value="Swap Numbers"/>

      </td>

      </tr>

      </table>

     </div><br>

       {{ before_swap }}

      <br><br>

      {{ after_swap }}

     </div>

  </body>

</html>

Thursday, August 19, 2021

Count Consonants in AngularJS

Count Consonants in AngularJS

Machine  Problem

Write a program that will ask user to give a string and then the program will display the given string, and then it will count the number of consonants in the given string.

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     : July 21, 2021  Wednesday  10:34 PM

  Place    : Bacolod City, Negros Occidental

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

  Email    : jakerpomperada@gmail.com

 -->

<html ng-app="mainApp">

<head>

<title>Count Consonants in AngularJS</title>

</head>

<style>

body {

font-family: arial;

font-size: 25px;

font-weight: bold;

}

</style>

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

</script>


<script type="text/javascript">


// AngularJS Controller Declaration

angular.module('mainApp', []).service('myService', function() {

  this.myFunc = function(val_1) {

   


    var countConsonants = 0;

     str_upper = val_1.toUpperCase();

    

   

  for (var i = 0; i < str_upper.length; i++) {

    if (str_upper.charAt(i) !== "A" && str_upper.charAt(i) !== "E" && str_upper.charAt(i) !== "I" 

      && str_upper.charAt(i) !== "O" && str_upper.charAt(i) !== "U" && str_upper.charAt(i) !== " ") {

      countConsonants++;

    }

  }

    return countConsonants;

  };

}).controller('Count_Consonants_Controller', function($scope, myService) {

  $scope.check = function(val_1) {

    $scope.myUserService = myService.myFunc(val_1);

  }


});

</script>


<div ng-app="mainApp" ng-controller="Count_Consonants_Controller">

<form>

<table border="0" cellspacing=10>

<tr>Count Consonants in AngularJS</tr>

<tr>

  <td>Enter a String</td>

<td><input type="text"  size="50" ng-model="val_1" ng-init="val_1=''" ng-keyup="check(val_1)"/></td>

</tr>

<table>

</form><br>

<b>The given string {{val_1 | uppercase }}. </b><br><br>

   <b>The number of consonants is {{myUserService}}.</b>

</div>

</body>

</html>



Consonants and Vowels in C Improved Version

Consonants and Vowels in C Improved Version

 A simple program that I wrote using C programming language to ask the user to give a string and then the program will count the number of vowels, and consonants improved version and display the results on 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

/* main.c

  Prof. Jake Rodriguez Pomperada, MAED-IT, MIT

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

  jakerpomperada@gmail.com

  Bacolod City, Negros Occidental Philippines

  August 19, 2021   Thursday   6:26 AM

*/


#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <stdbool.h>


bool is_vowel(char ch)

{

  const char vowels[] = "aeiouAEIOU";


  return strchr(vowels, ch) != NULL;

}


bool is_consonant(char ch)

{

  const char consonats[] = "bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ";


  return strchr(consonats, ch) != NULL;

}


int main()

{

  char str[100]; int i=0;

  int vowels=0,consonants=0, a = 0;


  printf("\n\n\tConsonants and Vowels in C Improved Version\n");

  printf("\nGive a String : ");

  // scanf("%s",&str); reads only till the first whitespace

  fgets(str, sizeof(str), stdin);

  char *pos = strrchr(str, '\n'); 

  // fgets sometines leaves a trailing \n in the str

  if(pos != NULL)

    pos = '\0';

  for(i=0; str[i]!='\0'; i++)

  {

    if(is_vowel(str[i]))

    {

      a++;

      vowels++;

      printf("\n %d. The Vowels is: %c",a,str[i]);

    }

    else if (is_consonant(str[i]))

    {

      a++;

      consonants++;

      printf("\n %d. The Consonant is: %c",a,str[i]);

    }

  }

  printf("\n\n\nThe Total Number of Vowels : %d",vowels);

  printf("\nThe Total Number of Consonants  : %d",consonants);

  printf("\n\n\tEnd of Program\n\n");


  return EXIT_SUCCESS;

} /* End of Code */

Wednesday, August 18, 2021

Lower Case To Upper Case String Conversion in C++

Lower Case To Upper Case String Conversion in C++

 I simple program that I wrote to accept string from the user in lowercase and convert it into upper case format 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

// lowercase_uppercase.cpp

// Prof. Jake Rodriguez Pomperada, MAED-IT, MIT

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

// jakerpomperada@gmail.com

// Bacolod City, Negros Occidental Philippines

// Dev C++ Version 5.11


#include <iostream>

#include <string>


using namespace std;


int main()

{

  

    string str;

   

   cout << "\n\n";

   cout << "\tLower Case To Upper Case String Conversion in C++";

   cout << "\n\n";

   cout << "\tEnter a String : ";

   getline(cin,str);

    for (size_t i = 0; i < str.length(); ++i)

    {

        str[i]=toupper(str[i]);

    }


    cout << "\n\n";

    cout<<"\tConverted Results in Upper Case : "  <<str << ".";

    cout << "\n\n";

    cout << "\tEnd of Program";

    cout << "\n\n";

    system("PAUSE");


}


Vowels and Consonants in C

Count Vowels, and Consonants in C

 A simple program that I wrote using C programming language to ask the user to give a string and then the program will count the number of vowels, and consonants and display the results on 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

/* vowels_consonants.c
 Author : Prof. Jake Rodriguez Pomperada, MAED-IT, MIT
 Websites : www.jakerpomperada.com and www.jakerpomperada.blogspot.com
 Email : jakerpomperada@gmail.com
 Tool  : Dev C++ 5.11
 Location : Bacolod City, Negros Occidental Philippines
*/

#include <stdio.h>
#include <string.h>


int i=0,a=0,vowels=0,consonants=0;
char str[100];

void main()
{
printf("\n\n");
printf("\tCount Vowels, and Consonants in C");
printf("\n");
printf("\nGive a String : ");
    scanf("%s",&str);
     for (i = 0; i < strlen(str); ++i)
    {
        str[i]=toupper(str[i]);
    }
for(i=0;str[i]!='\0';i++)
{
    
  if(str[i]=='A' | str[i]=='E' | str[i]=='I' | str[i]=='O' | str[i]=='U')
{
a++;
vowels++;
printf("\n %d. The Vowels is: %c",a,str[i]);
}
else
{
a++;
consonants++;
printf("\n %d. The Consonants is: %c",a,str[i]);
}
}
    printf("\n");
printf("\n\nThe Total Number of Vowels : %d",vowels);
printf("\nThe Total Number of Consonants  : %d",consonants);
printf("\n\n");
printf("\tEnd of Program");
printf("\n\n");
} /* End of Code */



Tuesday, August 17, 2021

Shell Sort in C

Shell Sort Program in C

 A simple shell 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

/* shell_sort.c
   Author   : Mr. Jake Rodriguez Pomperada,MAED-IT, MIT
   Tool     : Dev C++ 5.11
   Date     : August 15, 2021   Sunday  4:29 PM
   Websites  : www.jakerpomperada.com and www.jakerpomperada.blogspot.com
   Email    :jakerpomperada@gmail.com
   Location : Bacolod City, Negros Occidental, Philippines
*/

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

void shellsort(int arr[], int num);

int main()
{
 int items[1000], num=0,min=0,loc=0;
 int c=0, b=0,change=0,j=0,temp=0;
 system("cls");
 printf("\n\n");
 printf("\tShell Sort Program in C");
 printf("\n\n");
 printf("\tHow many items? : ");
 scanf("%d", &num);
 printf("\n\n");
 for (c= 0; c < num; c++) {
    printf("\tEnter item no. %d: ", c+1);
    scanf("%d", &items[c]);
 }
printf("\n\n");
printf("\tOriginal Arrangement of Numbers");
printf("\n\n");
 for ( c = 0 ; c < num ; c++ ) {
   printf("\t%d ",items[c]);
 }
 shellsort(items, num);
 printf("\n\n");
 printf("\tAsceding Order of Numbers");
 printf("\n\n");
 for ( c = 0 ; c < num ; c++ ) {
 printf("\t%d ", items[c]);
 }  
printf("\n\n");
printf("\tEnd of Program");
printf("\n\n");
system("pause");
}

void shellsort(int arr[], int num)
{
    int i, j, k, tmp;
    for (i = num / 2; i > 0; i = i / 2)
    {
        for (j = i; j < num; j++)
        {
            for(k = j - i; k >= 0; k = k - i)
            {
                if (arr[k+i] >= arr[k])
                    break;
                else
                {
                    tmp = arr[k];
                    arr[k] = arr[k+i];
                    arr[k+i] = tmp;
                }
            }
        }
    }
}