Sunday, September 3, 2017

Minimum Value Checker in Java

A very simple program that I wrote using Java to check which of the list of numbers in an array is the smallest in terms of numerical value.  The code is very simple and easy to understand.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.



Sample Program Output



Program Listing


minimum_value.java


/**
 * 
 */
package array_demo;

/**
 * @author Jacob
 *
 */
public class minimum_value {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int a=0,min_value=0;
int b[] = {100,35,567,5,62};
min_value=b[0];
for (a=0; a<5; a++)
{
if (min_value > b[a])
{
min_value=b[a];
}
}

 System.out.println();
       System.out.println("Minimum Value Checker in Java");
       System.out.println();
       System.out.println("Written By Mr. Jake R. Pomperada, MAED-IT");
       System.out.println();
System.out.print("The Minimum value in the array is " + min_value + ".");
System.out.println("\n\n");
       System.out.println("End of Program");
       System.out.println();
}

}



Method Overloading in Java

Here is a sample program that shows you how to perform method overloading in Java. The code is very simple and shows your one of the most important concepts of object oriented programming in Java.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.


Program Listing


/**
 * 
 */
package method_overload;

/**
 * @author Jacob Samuel F. Pomperada
 * September 3, 2017
 * Sunday
 * Mandaluyong City, Metro Manila
 *
 */


class product {
private int a;
private int b;
    product()
{
a=5;
b=10;
}
    
   product(int x, int y)
    {
    a=x;
    b=y;
    }
   product(product z)
   {
  
  a= z.a;
  b= z.b;
   }
   
   
int compute()
{
return a*b;
}


}

public class test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
product test1 = new product();
product test2  = new product(2,3);
product test3  = new product(test2);
System.out.println();
        System.out.println("Method Overloading in Java");
        System.out.println();
        System.out.println("Written By Mr. Jake R. Pomperada, MAED-IT");
        System.out.println();
        System.out.println("The value is " +  test1.compute());
        System.out.println("The value is " +  test2.compute());
        System.out.println("The value is " +  test3.compute());
        System.out.println();
        System.out.println("End of Program");
        System.out.println();

}

}




Inventory and Accounting System in Visual Basic 6

In this article I would like to share with you the work of my good friend and fellow software engineer Mr. Joseph Salac it is a an Inventory and Account System in Visual Basic 6 which has a function also of Point of Sale. I request Joseph if he can share his code to us and he send me a copy of this one. Thank you very much Joseph for this one it will be appreciated by our fellow programmers around the world who visited my website.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Saturday, September 2, 2017

Fibonacci Numbers in C++

Here is a very simple program that will ask the user to give a number and then our program will generate the fibonacci series of numbers using C++ as our programming language.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.




Program Listing


#include <iostream>

using namespace std;


int main()
{
int x=0,y=0,i=0, n=0 ,sum=0;

cout << "===== FIBONACCI NUMBERS IN C++ =====";
cout << "\n\n";
cout<<"Give a Number : ";
cin>>n;
cout<<"Fibonacci Series is : "<<"\n";
x=0;
y=1;
cout<<x;
cout << "\n\n";
cout<<y;
for(i=3;i<=n;i++)
{
sum=x+y;
cout<<sum<<"\n";
x=y;
y=sum;
}
cout << "\n\n";
cout<<"End of Program";
cout << "\n\n";
}












Fibonacci Numbers in Visual Basic 6

A very simple program that I wrote using Microsoft Visual Basic 6 to accept a number from our user and generate a series of Fibonacci Numbers based on the given number by our user. The code is very simple and easy to understand.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Sample Program Output


Program Listing

'Fibonacci Numbers in Visual Basic 6
'Date : September 2, 2017
' Written By: Mr. Jake R. Pomperada, MAED-IT
' Mandaluyong City, Metro Manila Philippines


Private Sub Command1_Click()
Dim a, b, c, input_values As Integer
Picture1.Cls
input_values = Val(Text1.Text)
a = 1
For x = 1 To input_values
    If x > 2 Then
        c = a + b
        a = b
        b = c
        Picture1.Print c & Space(2);
    Else
        Picture1.Print a & Space(2);
        b = a
    End If
Next x
End Sub

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

Private Sub Command3_Click()
End
End Sub



Swap Two Numbers in Visual Basic 6

In this article I would like to share with you a very simple program that I wrote in Microsoft Visual Basic 6 to ask the user to give two numbers and then our program will swap or interchange the two number being provided by our user. The code uses a procedure that I wrote in Visual Basic 6 I hope you will find my work useful. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Sample Program Output



Program Listing

'Swap Two Numbers in Visual Basic 6
'Date : September 2, 2017
' Written By: Mr. Jake R. Pomperada, MAED-IT
' Mandaluyong City, Metro Manila Philippines

Public Sub SwapTwoNumbers(Var1 As Integer, Var2 As Integer)
  Dim TempVar As Integer
  TempVar = Var1
  Var1 = Var2
  Var2 = TempVar
  
  Text3.Text = Var1
  Text4.Text = Var2
End Sub


Private Sub Command1_Click()
Dim A As Integer
Dim B As Integer

A = Val(Text1.Text)
B = Val(Text2.Text)

SwapTwoNumbers A, B

End Sub

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

Private Sub Command3_Click()
End
End Sub






Thursday, August 31, 2017

Reverse A String in Java

In this article I would like to share with you a simple program that will ask the user to give any string and then our program will reverse the given string by our user using Java as our programming language. I am using Eclipse as my IDE in writing this program. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Sample Program Output


Program Listing


Reverse_String_Demo.java

/**
 * 
 */
package Reverse_String;

import java.util.*;

/**
 * @author Jacob
 *
 */
public class Reverse_String_Demo {

 public static String  Reverse_Me(String str) {
    
 String Rev_Str;
 
   Rev_Str = "";
   
       for(int a= str.length()-1; a>=0; a--) {
           Rev_Str = Rev_Str + str.charAt(a);
       }
       
       System.out.print("\n\n");
       System.out.println("The Reversed String is " + Rev_Str + ".");
       System.out.println();
       System.out.println("End of Program");
       System.out.println();
       return str; 
 }
/**
* @param args
*/
public static void main(String[] args) {
Scanner user_input =new Scanner(System.in);
String str_me;

        System.out.println();
        System.out.println("Reverse A String in Java");
        System.out.println();
        System.out.println("Written By Mr. Jake R. Pomperada, MAED-IT");
        System.out.println();
System.out.print("Enter any string: ");
        str_me = user_input.nextLine();
        
        Reverse_Me(str_me);
        
        user_input.close();

}

}




Saturday, August 26, 2017

Product of Two in Java Using Getters and Setters

A very simple program that I wrote in Java to demonstrate how to use getters and setters concepts in object oriented programming. The code will ask the user to give two numbers and then our program will compute that product of the two numbers given by our users. 

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.



Sample Program Output


Program Listing


Product_Two.java


// Written By: Mr. Jake R. Pomperada, MAED-IT
// Date : August 26, 2017  Sunday 7:36 AM
// Language: Java
// Place of Origin:  Mandaluyong City, Metro Manila Philippines.


package product_number;

import java.util.Scanner;

public class Product_Two {

int val_a;
int val_b;
public int getVal_a() {
return val_a;
}


public void setVal_a(int val_a) {
this.val_a = val_a;
}


public int getVal_b() {
return val_b;
}


public void setVal_b(int val_b) {
this.val_b = val_b;
}


public int solveProduct()
{
return(val_a * val_b);
}
public static void main(String[] args) {
  
Scanner input = new Scanner(System.in);
  
  Product_Two num = new Product_Two(); 
    
       System.out.println();
       System.out.println("Product of Two in Java Using Getters and Setters");
       System.out.println();
       System.out.print("Enter first value : ");
       num.val_a = input.nextInt();
       System.out.print("Enter second value : ");
       num.val_b = input.nextInt();

        num.setVal_a(num.val_a);
        num.setVal_b(num.val_b);
        num.getVal_a();
        num.getVal_b();
        
        num.solveProduct();
     
        System.out.println();
        System.out.print("The product of " +num.val_a + " and " + num.val_b + " is " + num.solveProduct() + ".");
        System.out.println("\n");
        System.out.print("\t END OF PROGRAM");
        input.close();
}

}



Friday, August 25, 2017

Finding the Smallest Value Using Scala

Hi Guys in this article I would like to share with you how to use one dimensional array in Scala and how we can able to determine which of the values in our array is the smallest in terms of numerical value. The code is very short and easy to understand. I am using IntelliJ IDEA community edition 2017.2 edition as my text editor in writing this code. I hope you will find my work useful. Thank you very much for all the support in my website.
I hope you will find my work useful and beneficial. If you have some questions about programming, about my work please send mu an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com. People here in the Philippines can contact me at  my mobile number 09173084360.
Thank you very much and Happy Programming.
Sample Program Output
Program Listing
Smallest.scala
object Smallest { def main(args: Array[String]) { var listValues = Array(100,45,1240,12,50,531,62,376); print("\n\n"); print("Finding the Smallest Value Using Scala"); print("\n\n"); print("Written By: Mr. Jake R. Pomperada, MAED-IT"); print("\n\n"); for ( a <- listValues ) { print(" " + a + " "); } var smallest = listValues(0); for ( b <- 1 to (listValues.length - 1) ) { if (listValues(b) < smallest) smallest = listValues(b); } print("\n\n"); println("The Smallest Number in the list is " + smallest + "."); print("\n\n"); print("\t END OF PROGRAM"); print("\n\n"); }

Finding the Biggest Value Using Scala

Hi Guys in this article I would like to share with you how to use one dimensional array in Scala and how we can able to determine which of the values in our array is the highest in terms of numerical value. The code is very short and easy to understand. I am using IntelliJ IDEA community edition 2017.2 edition as my text editor in writing this code. I hope you will find my work useful. Thank you very much for all the support in my website.

I hope you will find my work useful and beneficial. If you have some questions about programming, about my work please send mu an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com. People here in the Philippines can contact me at  my mobile number 09173084360.

Thank you very much and Happy Programming.




Sample Program Output


Program Listing


Biggest.scala


object Biggest {

  def main(args: Array[String]) {

    var listValues = Array(100,45,1240,12,50,531,62,376);

    print("\n\n");
    print("Finding the Biggest Value Using Scala");
    print("\n\n");
    print("Written By: Mr. Jake R. Pomperada, MAED-IT");
    print("\n\n");

    for ( a <- listValues ) {
      print(" " + a + " ");
    }

    var biggest = listValues(0);

    for ( b <- 1 to (listValues.length - 1) ) {
      if (listValues(b) > biggest)
        biggest = listValues(b);
    }
    print("\n\n");
    println("The Biggest Number is " + biggest + ".");
    print("\n\n");
    print("\t END OF PROGRAM");
    print("\n\n");
  }
}

Sunday, August 20, 2017

For Loop in Scala

A very simple program to demonstrate how to use for loop statement in Scala programming language. The code is very basic and easy to understand.

I hope you will find my work useful and beneficial. If you have some questions about programming, about my work please send mu an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com. People here in the Philippines can contact me at  my mobile number 09173084360.

Thank you very much and Happy Programming.



Sample Program Output


Program Listing

ForLoop.scala

object ForLoop {

  def main(args: Array[String]) {
    var x = 0;


    print("\n\n");
    print("For Loop in Scala");
    print("\n\n");

    for (x <- 1 to 15) {
      println("Value of x is " + x);
    }
  }
}