Saturday, May 21, 2022

Sum, Average, Minimum and Maximum Values in C#

 A simple program to solve the sum, average, minimum and maximum values 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 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.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada

09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada


Thank you very much for your support.





Program Listing

using System;
using System.Linq;

class Max_Min
{
  static void Main(string[] args)
  {
    double[] numbers = { 1.2, 9.3, 1.6, 2.5 };

    DisplayArray(numbers);
    Sum_Average(numbers);
    Max_Value(numbers);
    Min_Value(numbers);

    Console.ReadKey();
  }

  private static void Min_Value(double[] numbers)
  {
    double min = numbers.Min();

    Console.WriteLine("Min is " + min);

  }

  private static void Max_Value(double[] numbers)
  {
    double max = numbers.Max();
    Console.WriteLine("Max is " + max);
  }

  private static void Sum_Average(double[] numbers)
  {
    double sum = numbers.Sum();
    double avg = numbers.Average();
    
    Console.WriteLine("Total is " + sum);
    Console.WriteLine("Average is " + avg);
  }

  private static void DisplayArray(double[] numbers)
  {
    Console.WriteLine("These are the elements in the array:");
    Console.Write("| ");
    foreach(double num in numbers)
      Console.Write(num + " | ");

    Console.WriteLine("\n");
  }
}

Friday, May 20, 2022

Decimal To Octal in PHP

Decimal To Octal in PHP

 A program that will ask the user to give a decimal number and then it will convert into octal equivalent using 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 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.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada

09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada


Thank you very much for your support.




Program Listing

index.htm

<?php
    $output = "";
    if (isset($_POST["txtNumber"])) {
        $output = '<div class="output">Octal Value = '.
                        decoct($_POST["txtNumber"]).
                  '</div>';
    }
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Decimal To Octal In PHP</title>
    <style>
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        body {
            background-color: #eee;
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            font-family: sans-serif;
        }
        form {
            background: #fff;
            padding: 30px;
            border-radius: 10px;
        }
        h2 {
            margin-bottom: 20px;
        }
        label,
        input,
        button {
            display: block;
            width: 100%;
            font-size: 14px;
        }
        label {
            padding: 5px 0;
        }
        input {
            padding: 5px;
            margin-bottom: 5px;
        }
        button {
            padding: 8px 0;
            background-color: #03a9f4;
            border: none;
            border-radius: 3px;
            color: #fefefe;
            cursor: pointer;
        }
        .output {
            margin-top: 10px;
            background-color: #607d8b;
            padding: 12px 0;
            color: #fefefe;
            text-align: center;
        }
    </style>
</head>
<body>
    <form action="" method="post">
        <h1>Decimal To Octal In PHP</h1>
        <h2>Jake R. Pomperada, MAED-IT, MIT</h2>
        <label for="txtNumber">Enter a number to convert:</label>
        <input type="number" name="txtNumber" id="txtNumber" value="<?= isset($_POST["txtNumber"])?$_POST["txtNumber"]:""; ?>" autofocus>
        <button type="submit">Convert To Octal</button>
        <?= $output; ?>
    </form>
</body>
</html>

Odd and Even Numbers Using ng-init in AngularJS

Odd and Even Numbers Using ng-init in AngularJS

 Machine Problem

Write a program that uses ng-init directive that will check if the given number is an even or odd, 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 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.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada

09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada


Thank you very much for your support.




Program Listing

index.htm

<!-- index.htm
  Author   : Prof. Jake Rodriguez Pomperada, MAED-IT, MIT
  Date     : July 29, 2021 Thursday  10:00 AM
  Place    : Bacolod City, Negros Occidental
  Websites : www.jakerpomperada.com and www.jakerpomperada.blogspot.com
  Email    : jakerpomperada@gmail.com
 -->
<html>
<head> 
<title>Odd and Even Numbers Using ng-init 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>Odd and Even Number Using ng-init in AngularJS</h3>
<body>
  <script>
      
   angular.module('app', []).filter('Check_Number', function() {
       return function(given_number) {
    if (given_number % 2 === 0)
          {
        display = "The given number " + given_number +
                " is an Even Number.";
          }
      else
          {
       display = "The given number " + given_number +
                " is an Odd Number.";
         }
        return(display);
    };
  });
               
      
    </script>
<div ng-app="app" ng-model="given_number" ng-init="given_number=13">
 <p> {{ given_number | Check_Number}}</p>
    </div>
</body>
</html>

Thursday, May 19, 2022

User Defined Method and Arrays in Java

User Defined Methods and Arrays in Java

 A Java program to demonstrate how to declare and use user-defined methods and arrays.







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.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada

09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada


Thank you very much for your support.


Program Listing


Max_Min.java


public class Max_Min {


public static void main(String[] args) {

// TODO Auto-generated method stub

double[] myList = {1.2, 9.3, 1.6, 2.5}; // Declare the array; assign values into array


    // Call the dispArray user-defined method to display the array contents to screen.

    dispArray(myList);

        

    Sum_Average(myList);

    Max_Value(myList);

            Min_Value(myList);

 

  }


  public static void dispArray(double[] myList) {


    // Print all the array elements

    System.out.println("These are the elements in the array:");

    System.out.print("|");

    for (int i = 0; i < myList.length; i++) {

      System.out.print(myList[i] + "|");

    }

    System.out.println();


  }

  

  

  private static void Sum_Average(double[] myList) {

  // Summing and averaging all elements

    double sum = 0;


    for (int i = 0; i < myList.length; i++) {

      sum += myList[i];

    }

    System.out.println();

    System.out.println("Total is " + sum);

    System.out.println("Average is " + (sum / myList.length));


    }


  

  private static void Max_Value(double[] myList) {

  // Finding the largest element

    double max = myList[0];

    for (int i = 1; i < myList.length; i++) {

      if (myList[i] > max) max = myList[i];

    }


    System.out.println("Max is " + max);

    }

  

  private static void Min_Value(double[] myList) {

   // Finding the smallest element

    double min = myList[0];

    for (int i = 1; i < myList.length; i++) {

      if (myList[i] < min) min = myList[i];

    }


    System.out.println("Min is " + min);


  }

} // End of Code




Wednesday, May 18, 2022

Add and Divide Two Numbers in C++

Add and Divide Two Numbers in C++

 A simple program that will ask the user to give two numbers and then the program computes the sum and quotient of the two given numbers using a 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 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.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada

09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada


Thank you very much for your support.





Program Listing

#include <iostream>

int main()
{
  
  double val1, val2;

  std::cout << std::endl <<std::endl; 
  std::cout <<"\tAdd and Divide Two Numbers in C++";
  std::cout << std::endl <<std::endl; ; 
  std::cout << "\tGive Two Numbers : ";
  std::cin >> val1 >> val2;

  std::cout << std::endl; 
  std::cout <<std::endl; 
  // addition of two numbers
  std::cout <<"\t" <<val1 << "+" << val2 << " = "<< val1+val2 
  << std::endl << std::endl;

   // division of two numbers
  std::cout <<"\t" << val1 << "/" << val2 << " = "<<val1/val2 << std::endl;
  std::cout << std::endl<<std::endl; 
  std::cout <<"\tEnd of Program";
  std::cout << std::endl; 
  return 0;
}

Tuesday, May 17, 2022

How To Check Java Version

Decimal To Binary in PHP

Decimal To Binary In PHP

 A simple program to ask the user to give a decimal value and then it will convert into binary equivalent using 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 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.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada

09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada


Thank you very much for your support.





Program Listing

<?php

    $output = "";

    if (isset($_POST["txtNumber"])) {

        $output = '<div class="output">Binary Value = '.

                        decbin($_POST["txtNumber"]).

                  '</div>';

    }

?>

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Decimal To Binary In PHP</title>

    <style>

        * {

            box-sizing: border-box;

            margin: 0;

            padding: 0;

        }

        body {

            background-color: #eee;

            min-height: 100vh;

            display: flex;

            justify-content: center;

            align-items: center;

            font-family: sans-serif;

        }

        form {

            background: #fff;

            padding: 30px;

            border-radius: 10px;

        }

        h2 {

            margin-bottom: 20px;

        }

        label,

        input,

        button {

            display: block;

            width: 100%;

            font-size: 14px;

        }

        label {

            padding: 5px 0;

        }

        input {

            padding: 5px;

            margin-bottom: 5px;

        }

        button {

            padding: 8px 0;

            background-color: #4caf50;

            border: none;

            border-radius: 3px;

            color: #fefefe;

            cursor: pointer;

        }

        .output {

            margin-top: 10px;

            background-color: #472781;

            padding: 12px 0;

            color: #fefefe;

            text-align: center;

        }

    </style>

</head>

<body>

    <form action="" method="post">

        <h1>Decimal To Binary In PHP</h1>

        <h2>Jake R. Pomperada, MAED-IT, MIT</h2>

        <label for="txtNumber">Enter a number to convert:</label>

        <input type="number" name="txtNumber" id="txtNumber" value="<?= isset($_POST["txtNumber"])?$_POST["txtNumber"]:""; ?>" autofocus>

        <button type="submit">Convert To Binary</button>

        <?= $output; ?>

    </form>

</body>

</html>

Monday, May 16, 2022

Reverse a String in C++

Reverse a String in C++

 A simple program to reverse a given string 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 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.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada

09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada


Thank you very much for your support.





Program Listing

#include <iostream>
#include <string>

int main()
{
  
   std::cout <<"\n\n";
   std::cout <<"\tReverse a String in C++";
   std::cout <<"\n\n";
   std::string original("Bacolod City Negros Occidental Philippines");
   std::string reversed_string(original.rbegin(), original.rend());

   std::cout << "\tOriginal: " << original << "\n\n";
   std::cout << "\tReversed: " << reversed_string << "\n";
   std::cout <<"\n\n";
   std::cout <<"\tEnd of Program";
   std::cout <<"\n\n";
}



Sunday, May 15, 2022

Age Checker in AngularJS

Age Checker in AngularJS

 Machine Problem

Write a program that uses ng-app directive that will check if the given age is already an adult, or still a minor, 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 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.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada

09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada


Thank you very much for your support.




Program Listing

index.htm

<!-- index.htm

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

  Date     : July 28, 2021 Wednesday 3:16 PM

  Place    : Bacolod City, Negros Occidental

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

  Email    : jakerpomperada@gmail.com

 -->

<html>

<head> 

<title>Age Checker Using ng-init 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>Age Checker Using ng-init in AngularJS</h3>

<body>

  <script>

      

   angular.module('app', []).filter('Check_Age', function() {

       return function(given_age) {

    if (given_age>=18)

          {

        display = "At the age " + given_age +

                " years old. You are already an Adult.";

          }

      else

          {

       display = "At the age " + given_age +

                " years old. You are still a Minor.";

         }

        return(display);

    };

  });

               

      

    </script>

<div ng-app="app" ng-model="given_age" ng-init="given_age=12">

 <p> {{ given_age | Check_Age}}</p>

    </div>

</body>

</html>

</body>

</html>