Friday, May 27, 2022

Decimal To Octal in JavaScript

 A program asks the user to give a decimal number and then the program will convert the given decimal number into an octal equivalent 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 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

<!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>Convert Decimal to Octal Using JavaScript</title>
    <style>
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        body {
            background-color: #b1bfd8;
            background-image: linear-gradient(315deg, #b1bfd8 0%, #6782b4 74%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            font-family: sans-serif;
        }
        form {
            background: #ccc;
            padding: 30px;
            border-radius: 10px;
        }
        h1, h2 {
            text-align: center;
        }
        h1 {
            text-transform: uppercase;
            margin-bottom: 5px;
            font-size: 30px;
        }
        h2 {
            margin-bottom: 20px;
            color: #2196f3;
            font-size: 20px;
            font-weight: 400;
        }
        label,
        input,
        button {
            display: block;
            font-size: 14px;
            outline: none;
        }
        label {
            padding: 5px 0;
        }
        .btn-group {
            display: flex;
        }
        input {
            border: 1px solid #ccc;
            border-right: none;
            border-radius:  3px 0 0 3px;
            width: 100%;
            padding: 10px;
        }
        button {
            padding: 10px 14px;
            background-color: #4caf50;
            border: none;
            border-radius:  0 3px 3px 0;
            color: #fefefe;
            cursor: pointer;
        }
        .output {
            margin-top: 10px;
            background-color: #607d8b;
            padding: 15px;
            color: #fefefe;
            text-align: center;
            max-width: 330px;
            word-wrap: break-word;
            border-radius: 3px;
        }
        .hidden {
            display: none;
        }
    </style>
</head>
<body>
    <form action="" method="post">
        <h1>Convert<br>Decimal to Octal<br>Using JavaScript</h1>
        <h2>Jake R. Pomperada, MAED-IT, MIT</h2>
        <label for="txtNumber">Enter a number to convert:</label>
        <div class="btn-group">
            <input type="number" name="txtNumber" id="txtNumber" autofocus required>
            <button type="submit">Convert</button>
        </div>
        <div class="output hidden"></div>
    </form>
    
    <script>
        document.querySelector('form').onsubmit  = (e) => {
            e.preventDefault()

            let number = parseInt(document.querySelector('#txtNumber').value),
                output = document.querySelector('.output')
            
            result = number.toString(8)
            output.classList.remove("hidden")
            output.innerHTML = 'Octal Value: ' + result
        }
    </script>
</body>
</html>

Thursday, May 26, 2022

Decimal To Binary Using JavaScript

Decimal To Binary Using JavaScript

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

<!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>Convert Decimal to Binary Using JavaScript</title>

    <style>

        * {

            box-sizing: border-box;

            margin: 0;

            padding: 0;

        }

        body {

            background-color: #d8dede;

            background-image: linear-gradient(315deg, #d8dede 0%, #e5bdf6 74%);

            min-height: 100vh;

            display: flex;

            justify-content: center;

            align-items: center;

            font-family: sans-serif;

        }

        form {

            background: #fff0f0;

            /* background: rgba(255, 255, 255, 0.4); */

            padding: 30px;

            border-radius: 10px;

        }

        h1, h2 {

            text-align: center;

        }

        h1 {

            text-transform: uppercase;

            margin-bottom: 5px;

            font-size: 30px;

        }

        h2 {

            margin-bottom: 20px;

            color: #ff9800;

            font-size: 20px;

            font-weight: 400;

        }

        label,

        input,

        button {

            display: block;

            font-size: 14px;

            outline: none;

        }

        label {

            padding: 5px 0;

        }

        .btn-group {

            display: flex;

        }

        input {

            border: 1px solid #ccc;

            border-right: none;

            border-radius:  3px 0 0 3px;

            width: 100%;

            padding: 10px;

        }

        button {

            padding: 10px 14px;

            background-color: #3D5A80;

            border: none;

            border-radius:  0 3px 3px 0;

            color: #fefefe;

            cursor: pointer;

        }

        .output {

            margin-top: 10px;

            background-color: #EE6C4D;

            padding: 15px;

            color: #fefefe;

            text-align: center;

            max-width: 330px;

            word-wrap: break-word;

            border-radius: 3px;

        }

        .hidden {

            display: none;

        }

    </style>

</head>

<body>

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

        <h1>Convert<br>Decimal to Binary<br>Using JavaScript</h1>

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

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

        <div class="btn-group">

            <input type="number" name="txtNumber" id="txtNumber" autofocus required>

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

        </div>

        <div class="output hidden"></div>

    </form>

    

    <script>

        document.querySelector('form').onsubmit  = (e) => {

            e.preventDefault()


            let number = parseInt(document.querySelector('#txtNumber').value),

                output = document.querySelector('.output')

            

            result = number.toString(2)

            output.classList.remove("hidden")

            output.innerHTML = 'Binary Value: ' + result

        }

    </script>

</body>

</html>

Wednesday, May 25, 2022

Horizontal Tab in C++

Horizontal Tab in C++

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

using namespace std;

int main()
{
cout <<"\tThis is my C++ program\n";
cout <<"\t\tBacolod City\n";
cout <<"\t\t\tC++ is fun to learn";
}

Bigger Between Two Numbers in C++

Bigger Between Two Numbers in C++

 A program that will check and determine which of the two given numbers by the user has a bigger numerical value or they have the same numerical value 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>  

/* Bigger Between Two Numbers in C++ */

using namespace std;
   
int main() {  
    int a=0, b=0;  
    cout <<"\n";
    cout <<"\tBigger Between Two Numbers in C++";
    cout <<"\n\n";
    cout <<"\tGive Two Integer Numbers : ";  
    cin >> a >> b;
    cout <<"\n\n";
    
if(a > b) 
    {
        cout <<"\t" << a << " is the largest number.\n";
     
    } 
    else if (b > a)
    { 
       cout <<"\t" << b << " is the largest number.\n";
    } 
    else 
    {
cout <<"\tBoth are Equal Numbers. \n";
    }
    cout <<"\n";
    cout <<"\tEnd of Program";
    cout <<"\n\n";
    return 0;  
}


Tuesday, May 24, 2022

Positive and Negative Number Checker in Visual Basic 6

Positive and Negative Number Checker in Visual Basic 6

 A simple program that I wrote using Visual Basic 6 asks the user to give a number and then the program will check if the given number is a positive or negative number.

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

Private Sub Command1_Click()
' Written By Jake Rodriguez Pomperada, MAED-IT, MIT
' www.jakerpomperada.com  and www.jakerpomperada.blogspot.com
' jakerpomperada@gmail.com

Dim a As Integer

a = Val(Text1.Text)

If (Text1.Text = "") Then
MsgBox "Cannot Be Empty. Try Again", vbInformation, "Result"
Text1.SetFocus
ElseIf (a < 0) Then
MsgBox "The given number " & a & " is a Negative Number", vbInformation, "Result"
Text1.SetFocus
Else
MsgBox "The given number " & a & " is a Positive Number", vbInformation, "Result"
Text1.SetFocus
End If
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text1.SetFocus
End Sub

Private Sub Command3_Click()
End
End Sub



Monday, May 23, 2022

Decimal To Hexadecimal in PHP

Decimal To Hexadecimal in PHP

 A simple program to ask the user to give a decimal value and then convert it into hexadecimal 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">Hexadecimal Value = '.

                         dechex($_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 Hexadecimal 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 Hexadecimal 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 Hexadecimal</button>

        <?= $output; ?>

    </form>

</body>

</html>


Sunday, May 22, 2022

Coin Flips Simulation in C++

Coin Flips Simulation in C++

 A simple coin flips simulation 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 <random>
#include <chrono>

using namespace std;

int main()
{
   std::default_random_engine generator;
   std::uniform_int_distribution<int> distribution(0,1);
   generator.seed(time(0));
   int flips{};
   cout <<"\n\n";
   cout << "\tCoin Flips Simulation in C++";
   cout <<"\n\n";
    cout << "\tHow many flips : ";
   cin >> flips;
   //you should not time the cin statement, as that introduces user
//response time in result.
  cout <<"\n\n";
   auto start = chrono::steady_clock::now();
   int heads{};
   for(int i{}; i<flips; i++)
       {
         heads += distribution(generator);
       }
    cout << "\theads: " << heads << " tails: " << flips-heads << endl;
    auto end = chrono::steady_clock::now();
    cout <<"\n\n";
    cout << "\tElapsed time: "
         << chrono::duration_cast<chrono::milliseconds>(end - start).count()
         << "ms\n";
   cout <<"\n\n";
   cout << "\tEnd of Program";
   cout <<"\n\n";
}