Sunday, February 12, 2023

Cube a Number Using a Method in Java

  A program that will ask the user to give a number and then a program will compute the cube value of the given number using a method 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

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


You can buy my C++ book online at  


https://www.mindshaperspublishing.com/product/beginners-guide-to-c-programming/


You can buy my book in introduction to computer networking at 

https://www.unlimitedbooksph.com/product-page/introduction-to-computer-networking


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 java.util.Scanner;


public class Main {



static double Cube_Number(double val_number) {

    return(Math.pow(val_number,3));

  }

  

public static void main(String[] args) {

Scanner scan = new Scanner(System.in);


        System.out.println();

        System.out.println("\tCube a Number Using a Method in Java");

        System.out.println();

        System.out.print("\tGive a Number : ");

int number = scan.nextInt();//accept number

scan.close();

//calculate cube a  number using a Method. 

double cube =  Cube_Number(number);

System.out.println();

System.out.println("\tCube of "+ number+ " is "+ cube);

System.out.println();

        System.out.println("\tEnd of Program");

        System.out.println();


}


}


Saturday, February 11, 2023

Square a Number Using a Method in Java

Square a Number Using a Method in Java

 A program that will ask the user to give a number and then a program will compute the square value of the given number using a method 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

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


You can buy my C++ book online at  


https://www.mindshaperspublishing.com/product/beginners-guide-to-c-programming/


You can buy my book in introduction to computer networking at 

https://www.unlimitedbooksph.com/product-page/introduction-to-computer-networking


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 java.util.Scanner;


public class Main {



static int Square_Number(int val_number) {

    return(val_number * val_number);

  }

  

public static void main(String[] args) {

Scanner scan = new Scanner(System.in);


        System.out.println();

        System.out.println("\tSquare a Number Using a Method in Java");

        System.out.println();

        System.out.print("\tGive a Number : ");

int number = scan.nextInt();//accept number

scan.close();

//calculate square using a Method. 

int square =  Square_Number(number);

System.out.println();

System.out.println("\tSquare of "+ number+ " is "+ square);

System.out.println();

        System.out.println("\tEnd of Program");

        System.out.println();


}


}

Friday, February 10, 2023

Heap Sort in C

Heap Sort in C

 A simple implementation of heap sort algorithm 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

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


You can buy my C++ book online at  


https://www.mindshaperspublishing.com/product/beginners-guide-to-c-programming/


You can buy my book in introduction to computer networking at 

https://www.unlimitedbooksph.com/product-page/introduction-to-computer-networking


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 <stdio.h>


void swap(int *x, int *y) {

  int temp = *x;

  *x = *y;

  *y = temp;

}


void compare(int arr[], int n, int i) {

  int largest = i;

  int l = 2 * i + 1;

  int r = 2 * i + 2;


  if (l < n && arr[l] > arr[largest]) {

    largest = l;

  }


  if (r < n && arr[r] > arr[largest]) {

    largest = r;

  }


  if (largest != i) {

    swap(&arr[i], &arr[largest]);

    compare(arr, n, largest);

  }

}


void heapSort(int arr[], int n) {

  int i;

  for (i = n / 2 - 1; i >= 0; i--) {

    compare(arr, n, i);

  }


  for (i = n - 1; i >= 0; i--) {

    swap(&arr[0], &arr[i]);

    compare(arr, i, 0);

  }

}


void printArrays(int arr[], int n) {

  int i;

  for (i = 0; i < n; i++) {

    printf("%d ", arr[i]);

  }

  printf("\n");

}


int main() {

  int array_values[] = {100, -45, 5, -67, 2, 16,877,-567};

  

  int n = sizeof(array_values) / sizeof(array_values[0]);


  printf("\n\n");

  printf("\tHeap Sort in C\n\n\n");

  printf("\tBefore Sorting\n\n");

  printArrays(array_values, n);

  

  printf("\n\n");

  heapSort(array_values, n);


  printf("\tAfter Sorting\n\n");

  printArrays(array_values, n);

  printf("\n\n");

  printf("\tEnd of Program\n");

  return 0;

}


Thursday, February 9, 2023

Today's Date in C

Today's Date in C

 A simple program to display the current day 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

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


You can buy my C++ book online at  


https://www.mindshaperspublishing.com/product/beginners-guide-to-c-programming/


You can buy my book in introduction to computer networking at 

https://www.unlimitedbooksph.com/product-page/introduction-to-computer-networking


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 <time.h>


#include <stdio.h>




int main() 


{

  

  time_t current_time = time(NULL);

  

  

  struct tm *time_info = localtime(&current_time);


   


  printf("\n\n");

    

  printf("\tToday's Date : %02d/%02d/%04d\n", 

   time_info->tm_mon + 1, time_info->tm_mday, time_info->tm_year + 1900);


   


 return 0;



}


How To Display The Current Date and Time Using Microsoft Visual Basic 6

How To Display Current Date and Time in Microsoft Visual Basic 6

 In this tutorial I will share with you how to display the current date and time using Microsoft Visual Basic 6 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

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


You can buy my C++ book online at  


https://www.mindshaperspublishing.com/product/beginners-guide-to-c-programming/


You can buy my book in introduction to computer networking at 

https://www.unlimitedbooksph.com/product-page/introduction-to-computer-networking


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 Form_Load()

Label1.Caption = Now()

End Sub


Tuesday, February 7, 2023

Convert Days to Years, Weeks and Days in Ruby

Convert Days to Years, Weeks and Days in Ruby

 Machine Problem

Write a program to ask the user to give input number of days and convert it to years, weeks and days and display the result on the screen using Ruby 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

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


You can buy my C++ book online at  


https://www.mindshaperspublishing.com/product/beginners-guide-to-c-programming/


You can buy my book in introduction to computer networking at 

https://www.unlimitedbooksph.com/product-page/introduction-to-computer-networking


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

# days.rb

# Author   : Jake Rodriguez Pomperada, BSCS,MAED-IT

# Date     : May 16, 2019   Thursday  3:17 PM

# Address  : Bacolod City, Negros Occidental

# Tools    : Eclipse IDE and Ruby Version 2.6.3

# Location : Bacolod City, Negros Occidental  

# Website  : http://www.jakerpomperada.com

# Emails   : jakerpomperada@gmail.com and jakerpomperada@yahoo.com

puts "\n\n"

print "\tConvert Days to Years, Weeks and Days in Ruby";

puts "\n\n"

print "\tHow Many Days :  ";

days = gets;

days = days.to_i;


# Conversion in this portion 

    years = (days / 365);   # Ignoring leap year 

    weeks = (days % 365) / 7;

    days  = days - ((years * 365) + (weeks * 7));


print "\n\n";

print "\t===== DISPLAY RESULT ====="

print "\n\n";

print "\tNumber of Years  : #{years}.\n"

print "\tNumber of Weeks  : #{weeks}.\n"

print "\tNumber of Days   : #{days}."

print "\n\n";

print "\tEND OF PROGRAM";

print "\n\n";


Count Vowels Using Pointers in C++

Sunday, February 5, 2023

Display a Text on the Screen Using a Function in C++

Display Text on The Screen Using a Function in C++

 A program to display a text on the screen using a function 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;


void display_text()

{

cout <<"To Display a Text on the Screen.";

}


int main()

{

display_text();

}

How To Close A Form in Microsoft Visual Basic 6?

How To Clear a Text Box in Microsoft Visual Basic 6

Bubble Sort in Java

Bubble Sort in Java

 A program to demonstrate how to declare and use bubble sort algorithm 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 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

public class  Main {

    public static void bubble_sort(int[] arr) {

        int n = arr.length;

        for (int i = 0; i < n - 1; i++) {

            for (int j = 0; j < n - i - 1; j++) {

                if (arr[j] > arr[j + 1]) {

                    int temp = arr[j];

                    arr[j] = arr[j + 1];

                    arr[j + 1] = temp;

                }

            }

        }

    }


    public static void main(String[] args) {

        int[] arr = {-5, 134, 6, 450, 235, 15,51};

        

        System.out.println();

        System.out.println("\tBubble Sort in Java\n");

        

        System.out.println("UnSorted Values");

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

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

        }

        System.out.println();

        

        bubble_sort(arr);

        

        System.out.println("Sorted Values");

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

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

        }

    }

}


Pounds To Kilograms in Visual Basic 6