Tuesday, February 14, 2023

Heap Sort in C++

 A program that I wrote to demonstrate the concept of heap sort algorithm 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 <iostream>

  

  using namespace std;

  

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

    int max = i; 

    int leftChild = 2 * i + 1;

    int rightChild = 2 * i + 2;

  

    

    if (leftChild < n && arr[leftChild] > arr[max])

      max = leftChild;

  

   

    if (rightChild < n && arr[rightChild] > arr[max])

      max = rightChild;

  


    if (max != i) {

      swap(arr[i], arr[max]);

      comparison(arr, n, max); 

    }

  }

  

  

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

    

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

      comparison(arr, n, i);

  

    

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

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

  

      comparison(arr, i, 0); 

    }

  }

  

 

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

    cout <<"\t";

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

      cout <<" " << arr[i] << " ";

    cout << "\n";

    

  }

  

  

  int main() {

    int array_values[] = {400, -1, -78, 212, 162, 8, 67, 35};

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

    

    cout << "\n\n";

    cout << "\tHeap Sort in C++\n\n";

    cout << "\tOriginal Array Values\n\n";

    display_results(array_values, n);

    heapSort(array_values, n);

  

     cout << "\n\n";

    cout << "\tSorted Array Values\n\n";

    display_results(array_values, n);

    cout <<"\n\n";

    cout <<"\tEnd of Program";

    cout <<"\n\n";

   }





Gotoxy in Dev C++

Gotoxy in Dev C++

 A simple program to show how to declare gotoxy command in Dev C++.

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

#include <windows.h>

#include <stdlib.h>


using namespace std;


int main() {

  

  

void gotoxy(short x, short y);

       

   

    gotoxy(25,5);

    cout <<"\tGotoxy in Dev C++";

cout <<"\n\n\n";

  system("pause");

}


void gotoxy(short x, short y)           //definition of gotoxy function//                                               

{

 COORD pos ={x,y};

 SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);

}


Monday, February 13, 2023

Divide and Product of Two Numbers in C++

Divide and Product of Two Numbers in C++

 A simple program to compute the quotient and product of two numbers 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 <iostream> using namespace std; int main() { int a=100,b=5; int divide=0, product=0; divide = a/b; product = a*b; cout <<"\n\n"; cout << "\tThe Quotient is " << divide << ".\n\n"; cout << "\tThe Product is " << product << ".\n"; }

Sunday, February 12, 2023

US Dollar To Japanese Yen in Java

US Dollar To Japanese Yen in Java

 A program to ask the user to give US Dollar value and convert it into Japanese Yen equivalent 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

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


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;

import java.text.DecimalFormat;


public class Main {



public static void main(String[] args) {


double usd = 0.00;

       double rate = 105.48;



Scanner scan = new Scanner(System.in);



        System.out.println();

        System.out.println("\tUS Dollar To Japanese Yen in Java");

        System.out.println();

        System.out.print("\tGive US Dollar : ");

    usd = scan.nextDouble();

scan.close();

        double yen = usd * rate;

    

System.out.println();

DecimalFormat df = new DecimalFormat("0.00");

        String formattedYen = df.format(yen);

        

        System.out.println("\t" + usd + " US dollars is equal to " + formattedYen + " Japanese yen.");

    

System.out.println();

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

        System.out.println();


}


}

Cube a Number Using a Method in Java

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