Thursday, June 23, 2022

Sum and Difference of Two Numbers in TypeScript

 A program that I wrote that will compute the sum and product of two numbers using TypeScript 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 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

sum_product.ts

var a=5; var b= 3;

var sum = (a+b);
var subtract = (a-b);


console.log("\n\n");
console.log("The sum of " + a + " and " + b + " is " + sum + ".\n");
console.log("The difference between " + a + " and " + b + " is " + subtract + ".\n");

Wednesday, June 22, 2022

Automatic Teller Machine Simulation in Scala

Automatic Teller Machine Simulation in Scala

 Machine Problem

Create and design a program that simulates an Automatic Teller Machine. The money  bill to be used in the program will be 1000,500,200 and 100 money bill denomination.

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 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


/* atm.scala

   Prof. Jake Rodriguez Pomperada, MAED-IT, MIT

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

   jakerpomperada@gmail.com

   January 8, 2022  7:58 PM Saturday

   Bacolod City, Negros Occidental

 */


import java.util.Scanner;


object  atm {

def main(args: Array[String]) : Unit = {

    var scanner = new Scanner(System.in);


       var bill1000=0; var bill500=0; var bill200=0; var bill100=0; 

       var total_balance=0; var withdraw=0; var money_left=0;

       var receive1000=0; var receive500=0; var receive200=0; var receive100=0;

       var withdraw_again='n';


 do


{


    print("\n");

    print("\tAutomatic Teller Machine Simulation in Scala");

        print("\n\n");  

    print("\tHow many P1000 bills: ");

        bill1000 = scanner.nextInt();

print("\tHow many P500 bills: ");

bill500 = scanner.nextInt();

        print("\tHow many PHP 200 bills: ");

bill200 = scanner.nextInt();

        print("\tHow many PHP 100 bills: ");

bill100 = scanner.nextInt();


        total_balance = (bill1000 * 1000)+(bill500 * 500) + (bill200 * 200) +  (bill100 * 100) ;

    print("\n\n");

        print("\tTotal Balance: PHP " + total_balance);


         print("\n\n");

print("\tEnter amount to withdraw: PHP ");

withdraw = scanner.nextInt();

 

         money_left = withdraw ;


if  (withdraw > total_balance)

{

print("\tWithdraw amount greater than total balance.  ");

print("\n");

}

if (withdraw < total_balance)

{

if  (money_left >= 1000 )

{

receive1000 = (money_left / 1000);

if (receive1000 > bill1000 ) receive1000 = bill1000;


money_left = money_left - (receive1000 * 1000);

bill1000 = bill1000 - receive1000;

}


if  (money_left >= 500 )

{

receive500 = (money_left / 500);

if (receive500 > bill500 ) receive500 = bill500;


money_left = money_left - (receive500 * 500);

bill500 = bill500 - receive500;

}


if (money_left >= 200 )

{

receive200 = (money_left / 200);

if (receive200 > bill200 ) receive200 = bill200;

money_left = money_left - (receive200 * 200);

bill200 = bill200 - receive200;

}


if (money_left >= 100 )

  {

receive100 =(money_left / 100);

if (receive100 > bill100 ) receive100 = bill100;

money_left = money_left - (receive100 * 100);

bill100 = bill100 - receive100;

}


print("\n\n");

print("\tYou will receive:");

print("\n\n");

print("\tPHP 1000 bill :=>  " + receive1000);

print("\n");

print("\tPHP 500 bill :=>   " + receive500);

print("\n");

print("\tPHP 200 bill :=>   " + receive200);

print("\n");

print("\tPHP 100 bill :=>   " + receive100);

print("\n\n");


total_balance = total_balance - withdraw;


print("\tYour current balance is: PHP "  + total_balance);


print("\n\n");

print("\tYou only have balance of:");

print("\n\n");

print("\tPHP 1000 bill :=>  " +  bill1000);

print("\n");

print("\tPHP 500 bill  :=>  "  + bill500);

print("\n");

print("\tPHP 200 bill  :=>  "  + bill200);

print("\n");   

print("\tPHP 100 bill  :=>  "  + bill100)

                print("\n\n");

printf("\tAnother Withdraw Again ? Y/N : ");

        withdraw_again  = scala.io.StdIn.readChar()

}  

}  while (withdraw_again.toUpper == 'Y'); 

    print("\n");

                print("\tEnd of Program");

                print("\n\n");

 

       }

}



Tuesday, June 21, 2022

Simple Login Using JavaScript

Simple Login Using JavaScript

 A simple login that I wrote using JavaScript programming language.

 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 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

<!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>Simple Login Using JavaScript</title>

    <style>
        *,html {
            box-sizing: border-box;
            padding: 0;
            margin: 0;
        }
        main {
            display: flex;
            height: 100vh;
            width: 100vw;
            font-family: sans-serif;
        }
        .col {
            display: block;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
        }
        .col-1 {
            width: 65%;
            background: url("https://images.pexels.com/photos/807598/pexels-photo-807598.jpeg?cs=srgb&dl=pexels-sohail-nachiti-807598.jpg&fm=jpg&w=1920&h=1440");
            color: #fff;
            position: relative;
        }
        .col-1::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
            width: 100%;
            background: rgba(10, 44, 46, 0.8);
        }
        .col-2 {
            width: 35%;
            background-color: #fff;
        }
        .author {
            z-index: 1;
        }
        .author hr {
            width: 40px;
            margin: 30px auto;
        }
        .wrapper {
            width: 320px;
        }
        .logo {
            background-color: #154345;
            height: 60px;
            width: 60px;
            border-radius: 50%;
            margin: 0 auto 30px;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 26px;
        }
        h3 {
            font-size: 25px;
            margin-bottom: 10px;
            text-transform: uppercase;
        }
        p {
            margin-bottom: 30px;
            font-size: 14px;
        }
        .block {
            margin-bottom: 15px;
        }
        label {
            display: block;
            margin-bottom: 6px;
            text-align: left;
        }
        input{
            width: 100%;
            padding: 10px;
            border: 1px solid #4AA68C;
            outline: none;
            border-radius: 3px;
        }
        button {
            background: #4AA68C;
            color: #fff;
            padding: 10px 20px;
            width: 100%;
            font-size: 15px;
            text-transform: uppercase;
            border-radius: 3px;
            border: 0;
        }
    </style>
</head>
<body>
    <main>
        <div class="col col-1">
            <div class="author">
                <h1>Simple Login Using JavaScript</h1>
                <hr>
                <h2>Jake R. Pomperada, MAED-IT, MIT</h2>
            </div>
        </div>
        <div class="col col-2">
            <div class="wrapper">
                <div class="logo">
                    <span>&#128274;</span>
                </div>

                <h3>~ Login ~</h3>
                <p>Please enter your username and password below to access your account.</p>

                <form action="" method="post">
                    <div class="block">
                        <label for="">Username</label>
                        <input type="text" id="txtUsername">
                    </div>
                    <div class="block">
                        <label for="">Password</label>
                        <input type="password" id="txtPassword">
                    </div>
                    <button type="submit">Submit</button>
                </form>
            </div>
        </div>
    </main>

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

            let username  = "123", password  = "123",
                inputUser = document.querySelector('#txtUsername'),
                inputPass = document.querySelector('#txtPassword'),
                form      = document.querySelector("form")

            if (inputUser.value != username || inputPass.value != password) {
                alert("Username and Password do not match. Please try again.")
            }
            if (inputUser.value == username && inputPass.value == password) {
                alert("Success! You're currently logged in now.")
            }

            form.reset();
            inputUser.focus();
        }
    </script>
</body>
</html>

Monday, June 20, 2022

How To Write and Run a TypeScript Progam

Sum of Digits in C

Sum of Digits in C

 A simple program to ask the user to give a number and then the program will compute the sum of digits 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 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

/* Write a C program to Find Sum of Digits 

of a given number */



#include <stdio.h>


int main()

{

    int num=0, sum = 0;

 

    printf("\n\n");

    printf("\tSum of Digits in C\n");

    printf("\n\n");

    printf("\tGive a Number : ");

    scanf("%d",&num);

printf("\n\n");

    printf("\tThe given number %d.\n\n",num);


    //loop to find sum of digits

    while(num!=0){

        sum += num % 10;

        num = num / 10;

    }

 

    printf("\tThe sum of digits %d.\n",sum);

    printf("\n");

    printf("\tEnd of Program");

    printf("\n");

    return 0;


}

Sunday, June 19, 2022

Grade Solver Using Pointers in C++

Grade Solver Using Pointers in C++

 A simple program that I wrote to solve the grade of the student using struct and pointers 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 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>

#include <iomanip>

using namespace std;

struct student {
    string name;
    int age;
    float prelim,midterm,endterm;
};


float compute_grade(float *prelim,
                   float *midterm,
                   float *endterm)
{
  float solve=0.00;
  string remarks;

  solve = (*prelim * 0.30) +
          (*midterm * 0.30) +
          (*endterm * 0.40);

 if (solve >= 75.00)  {
     remarks = "PASSED";
 }
 else {
     remarks = "FAILED";
 }

 cout << fixed;
 cout << setprecision(0);
 cout << "\n\nThe student grade is " << solve
    << setw(10) << "Remarks: " <<setw(3)
    << remarks << ".";
 return(solve);
}


 int main() {


     student user;
     float *mypointer;

     cout << "\n\n";
     cout << "\t\tGrade Solver Using Pointers in C++";
     cout << "\n\n";
     cout << "\t Created By: Mr. Jake R. Pomperada, MAED-IT, MIT";
     cout << "\n\n";
     cout << "Enter the Name of the Student :";
     getline(cin,user.name);
      cout << "\n";
     cout << "Enter the Age of the Student  :";
     cin >> user.age;
     cout << "\n";
     cout << "Enter the Prelim Grade :";
     cin >> user.prelim;
     mypointer = &user.prelim;
     cout << "\n";
     cout << "Enter the Midterm Grade :";
     cin >> user.midterm;
     mypointer = &user.midterm;
     cout << "\n";
     cout << "Enter the Endterm Grade :";
     cin >> user.endterm;
     mypointer = &user.endterm;
     cout << "\n\n";
     cout << "\t ===== GENERATED REPORT =====";
     cout << "\n\n";
     cout << "\nStudent Name : " << user.name;
     cout << "\nStudent Age  : " << user.age;
     compute_grade(&user.prelim,&user.midterm,&user.endterm);


     cout << "\n\n";

     system("pause");
 }



Saturday, June 18, 2022

Odd and Even Numbers Using JOptionPane in Java

Odd and Even Number Using JOptionPane Using Java

 A program that I wrote will ask the user to give a number and then the program will check if the given number is odd or even using JOptionPane using Java 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 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


import javax.swing.JOptionPane;

/*  Jake Rodriguez Pomperada, MAED-IT, MIT
 *  www.jakerpomperada.com and www.jakerpomperada.blogspot.com
 *  jakerpomperada@gmail.com
 */

public class Odd_Even_Numbers {

public static void main(String[] args) {
// TODO Auto-generated method stub
int number;
        number = Integer.parseInt(JOptionPane.showInputDialog("Give a Number "));
        
        if(number%2==0)

        JOptionPane.showMessageDialog( null, "The given number "  + number + " is even number.",

           "The Result", JOptionPane.INFORMATION_MESSAGE );
        else
           JOptionPane.showMessageDialog( null, "The given number "  + number + " is odd number.",

                 "The Result", JOptionPane.INFORMATION_MESSAGE );
}

}