Friday, August 5, 2022

Display 10 To 1 Using For Loop in JavaScript

 A simple program to display a series of numbers in descending order 10 to 1 using for loop statement in 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

index.js


console.log();
console.log("\tDisplay 10 To 1 Using For Loop in JavaScript\n");

var array = [];

for(var i = 10; i >= 1; i--)
{
   array.push(i);
}
console.log("\t"+ array.join(','));
console.log();
console.log("\tEnd of Program");
console.log();

Thursday, August 4, 2022

Print 1 To 10 Using For Loop in JavaScript

Print 1 To 10 Using For Loop in JavaScript

 A simple program that I wrote to print 1 to 10 using for loop statement in 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 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.js


console.log();
console.log("\tPrint 1 To 10 Using For Loop in JavaScript\n");

var array = [];

for(var i = 1; i <= 10; i++)
{
   array.push(i);
}
console.log("\t"+ array.join(','));
console.log();
console.log("\tEnd of Program");
console.log();

Bakit Sikat Ang Visual Studio Code

Wednesday, August 3, 2022

Days of a Month Using Swing in Java

Days of the Month Using Swing in Java

 Machine Problem

Create a program that will input a value of days and output  the corresponding number of months and number of days.  Assume that 30 days is equivalent to 1 month.

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


/* Create a program that will input a value of days and output

 * the corresponding number of months and number of days. 

 * Assume that 30 days is equivalent to 1 month.

 * 

 */


import javax.swing.JOptionPane;


public class Month {


public static void main(String[] args) {

// TODO Auto-generated method stub

// obtain user input from JOptionPane input dialogs


      String days = 


         JOptionPane.showInputDialog( "Enter number of days : " );

      

      int days_value = Integer.parseInt(days); 

      

            

      if (days_value == 28 || days_value == 29) {

        JOptionPane.showMessageDialog( null,  "Month With 28 or 29 Days " + "\nFebruary" 

        , "The Result", JOptionPane.INFORMATION_MESSAGE );

            

      } else if (days_value == 31) {

      JOptionPane.showMessageDialog( null,  "Months With 31 Days\n" + "\nJanuary\r\n"

      + "March\r\n"

      + "May\r\n"

      + "July\r\n"

      + "August\r\n"

      + "October \r\n"

      + "December" 

          , "The Result", JOptionPane.INFORMATION_MESSAGE );

      } else if (days_value == 30) {

      JOptionPane.showMessageDialog( null,  "Months With 30 Days\n" + "\nApril\r\n"

      + "June\r\n"

      + "September\r\n"

      + "November\r\n"

      , "The Result", JOptionPane.INFORMATION_MESSAGE );

      } else {

      JOptionPane.showMessageDialog( null,"Invalid Days. Try Again", 

      "The Result", JOptionPane.INFORMATION_MESSAGE );

      }


}


}




Tuesday, August 2, 2022

Simple Login Using Swing in Java

Simple Login Using Swing in Java

 A simple login program using swing in 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

LoginDemo.java

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

import javax.swing.JOptionPane;


/**

 *

 * Simple Login Using Swing in Java

 *

 * @version 1.0 from 09/07/2022

 * @Jake Pomperada

 */


public class LoginDemo extends JFrame {

  /**

*/

private static final long serialVersionUID = 1L;

// start attributes

  private JLabel lblUsername = new JLabel();

  private JLabel lblPassword = new JLabel();

  private JTextField txtUSername = new JTextField();

  private JTextField txtPassword = new JTextField();

  private JButton bOK = new JButton();

  private JButton btnCancel = new JButton();

  // end attributes

  

  public LoginDemo() { 

    // Frame-Init

    super();

    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

    int frameWidth = 289; 

    int frameHeight = 205;

    setSize(frameWidth, frameHeight);

    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();

    int x = (d.width - getSize().width) / 2;

    int y = (d.height - getSize().height) / 2;

    setLocation(x, y);

    setTitle("LoginDemo");

    setResizable(false);

    Container cp = getContentPane();

    cp.setLayout(null);

    // start components

    btnCancel.setBounds(184, 120, 83, 25);

    btnCancel.setText("Cancel");

    btnCancel.setMargin(new Insets(2, 2, 2, 2));

    btnCancel.addActionListener(new ActionListener() { 

      public void actionPerformed(ActionEvent evt) { 

        btnCancel_ActionPerformed(evt);

      }

    });

    btnCancel.setMnemonic(KeyEvent.VK_A);

    cp.add(btnCancel);

    bOK.setBounds(104, 120, 75, 25);

    bOK.setText("OK");

    bOK.setMargin(new Insets(2, 2, 2, 2));

    bOK.addActionListener(new ActionListener() { 

      public void actionPerformed(ActionEvent evt) { 

        bOK_ActionPerformed(evt);

      }

    });

    cp.add(bOK);

    txtUSername.setBounds(104, 24, 161, 25);

    cp.add(txtUSername);

    lblUsername.setBounds(8, 24, 89, 25);

    lblUsername.setText("Username");

    cp.add(lblUsername);

    

    lblPassword.setBounds(8, 72, 89, 25);

    lblPassword.setText("Password");

    cp.add(lblPassword);

    txtPassword.setBounds(104, 72, 161, 25);

    cp.add(txtPassword);

    // end components

    

    setVisible(true);

  }

  

  // start methods

  

  public static void main(String[] args) {

    new LoginDemo();

  }

  public void bOK_ActionPerformed(ActionEvent evt) {

    String userName = txtUSername.getText();

    String passWord = txtPassword.getText();

    

    if(userName.equals("admin") && passWord.equals("123"))

      JOptionPane.showMessageDialog(this, "Login successful");

    else {

      JOptionPane.showMessageDialog(this, "Login failed");

    }

    

  }


  public void btnCancel_ActionPerformed(ActionEvent evt) {

    System.exit(0);

  }

}


Monday, August 1, 2022

Exception Handling in C++

Exception Handling in C++

 A simple program that I wrote in C++ to demonstrate how to declare and use exception handling.

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

/* a program that will ask the user to input a character 
and identify if the character is not an alphabet*/

#include <iostream>

using namespace std;

int main( )
 {
char let;
cout << "Exception Handling in C++\n\n";
 
try
{
cout << "Enter a character\n";
cin >> let;
cout <<"\n\n";
let=toupper(let);
if (!isalpha(let)) 
//isalpha - is a character detection type to identify if it is a letter
  throw let ;
cout<<let<<" is an alphabet!!:";
         
}
catch(char x)
{
cout << " Exception Thrown with\n"
            <<x<< " is not an alphabet!!.\n";
}

cout<<endl<<"End of program";
}  

Sunday, July 31, 2022

How To Run JavaScript Code Using Node.JS

How To Run JavaScript Code in Node.JS

 A simple program to add the sum of two numbers using JavaScript and run on Node.JS.

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


var a = 5;  var b = 6;  

var sum =0;

var sum = (a+b);

console.log("The sum of " + a + " and " + b + " is " + sum + ".");



Saturday, July 30, 2022

Swap Two Numbers Using JOptionPane in Java

Swap Two Numbers Using JOptionaPane in Java

A simple program that I wrote that will ask the user to give two numbers and then the program will swap the arrangement of two numbers using JOptionPane in 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

package demo;

import javax.swing.JOptionPane;

public class Activity_No_One {

public static void main(String[] args) {
// TODO Auto-generated method stub
// obtain user input from JOptionPane input dialogs

      String one = 

         JOptionPane.showInputDialog( "Enter first integer" );

      String two =

          JOptionPane.showInputDialog( "Enter second integer" );
      
      // convert String inputs to int values for use in a calculation

      int a = Integer.parseInt(one); 

      int b = Integer.parseInt(two);
      
      int temp=0;

      
      // display result in a JOptionPane message dialog

      JOptionPane.showMessageDialog( null,  "Value No. 1 : " + a + "\n" 
      + "Value No. 2 : " + b, "Before Swapping", JOptionPane.INFORMATION_MESSAGE );
      
      /*swapping */  
       temp = a;  
       a = b;  
       b = temp;  
       
       
       JOptionPane.showMessageDialog( null,  "Value No. 1 : " + a + "\n" 
          + "Value No. 2 :  " + b, "After Swapping", JOptionPane.INFORMATION_MESSAGE );

}

}