Tuesday, January 18, 2022

Two Decimal Places in C++

 A simple program that I wrote using C++ programming language to demonstrate two decimal places.

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.








Program Listing

#include <iostream>

#include <iomanip>


using std::string;


  int main() {

 

        float temperature = 123.3567;

        

        std::cout <<"\n";

        std::cout <<"\tTwo Decimal Places in C++";

        std::cout <<"\n\n";

        std::cout << std::fixed;

        std::cout << std::setprecision(2);

        std::cout <<"\tThe temperature is " << temperature <<"\n";

std::cout <<"\n";

        std::cout <<"\tEnd of Program";

        std::cout <<"\n";

        return 0;

  }



Monday, January 17, 2022

Sum of Diagonal Elements in a Matrix in Java

 A simple program to show how to solve the sum of diagonal elements in a matrix 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.





Program Listing

import java.util.*; class matrix { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int i,j,row,col,sum=0; System.out.println("Enter the number of rows:"); row = sc.nextInt(); System.out.println("Enter the number of columns:"); col = sc.nextInt(); int[][] mat = new int[row][col]; System.out.println("Enter the elements of the matrix") ; for(i=0;i<row;i++) { for(j=0;j<col;j++) { mat[i][j] = sc.nextInt(); } } System.out.println("The elements of the matrix") ; for(i=0;i<row;i++) { for(j=0;j<col;j++) { System.out.print(mat[i][j]+"\t"); } System.out.println(""); } for(i=0;i<row;i++) { for(j=0;j<col;j++) { if(i+j==2) //this condition checks for diagonal { sum = sum + mat[i][j]; } } } System.out.printf("SUM of DIAGONAL elements of the matrix = "+sum) ; } }

Sunday, January 16, 2022

String Compare in C++

String Compare in C++

 A program that demonstrates how to use the string compare function of the 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.






Program Listing


#include <iostream>

#include <cstring>


using namespace std;


int main()

{

char str1[100]="Computer";

char str2[100]="Computer";

cout <<"\n";

cout << "\tString Compare in C++";

cout <<"\n\n";

if(strcmp(str1,str2)==0)

   cout<<"\tThe result is true."<<endl;

else

  cout<<"\tThe result is false.\n";

cout <<"\n";

cout << "\tEnd of Program";

cout <<"\n";

}


Saturday, January 15, 2022

Kilograms to Pounds In PHP

Kilograms To Pounds in PHP

 A simple program to ask the user value in kilograms and then it will convert into pounds equivalent using PHP 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.





Program Listing

<?php $value_in_lb = ""; if (isset($_POST["txtValueInKg"])) { $value_in_lb = (int)$_POST["txtValueInKg"] * 2.20462262185; $value_in_lb = round($value_in_lb, 2); $value_in_lb = "<strong>". $_POST["txtValueInKg"] ."</strong>". " kg is equal to <strong>". $value_in_lb ."</strong> lb"; } ?> <!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>Feet To Inches in PHP</title> <style> *,html { box-sizing: border-box; padding: 0; margin: 0; } body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: #fefefe; font-family: sans-serif; background-color: #2196f3; } .container { background: #fff; border: none; text-align: center; color: #fff; width: 500px; } .title { background-color: #0474cd; padding: 20px; border: none; } .wrapper { padding: 30px 20px; font-size: 20px; background-color: #fff; border: none; color: #0474cd; } form { margin-bottom: 20px; } h1 { margin: 0 0 5px; line-height: 1; } p { margin: 15px 0 0; } input { display: block; width: 100%; margin-bottom: 20px; padding: 10px; font-size: 15px; text-align: center; } .output { margin: 10px 0; } button { background-color: #0474cd; color: #fff; border: none; border-radius: 2px; text-align: center; text-transform: uppercase; text-decoration: none; cursor: pointer; font-size: 15px; padding: 15px 10px; width: 100%; display: block; margin: 20px 0 0; } </style> </head> <body> <div class="container"> <div class="title"> <h1>Kilograms to Pounds In PHP</h1> <p>Created By:</p> <h2>&#187; Jake R. Pomperada, MAED-IT, MIT &#171;</h2> </div> <div class="wrapper"> <form action="" method="post"> <label>Enter a number here</label> <input type="number" name="txtValueInKg" required> <button type="submit" name="btnSubmit">Convert</button> </form> <?php echo $value_in_lb;?> </div> </div> </body> </html>

Making an Executable File in Python

Making an Executable File in Python

 In this article, I will show you how to create an executable file in a python 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.











Friday, January 14, 2022

Feet To Inches in PHP

Feet To Inches In PHP

 A simple program to ask the user to give length in fee and convert it into inches using PHP 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.





Progam Listing

<?php 

    $value_in_inches = "";


    if (isset($_POST["txtValueInFeet"])) {

        $value_in_inches = (int)$_POST["txtValueInFeet"] * 12;


        $value_in_inches = "<strong>". $_POST["txtValueInFeet"] ."</strong>".

                            " feet is equal to <strong>". $value_in_inches ."</strong> inches";

    }

?>

<!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>Feet To Inches in PHP</title>

    <style>

        *,html {

            box-sizing: border-box;

            padding: 0;

            margin: 0;

        }


        body {

            display: flex;

            justify-content: center;

            align-items: center;

            min-height: 100vh;

            background: #fefefe;

            font-family: sans-serif;

            background-color: #19BC9D;

        }


        .container {

            background: #fff;

            border: none;

            text-align: center;

            color: #fff;

            width: 470px;

        }


        .title {

            background-color: #14A083;

            padding: 20px;

            border: none;

        }


        .wrapper {

            padding: 30px 20px;

            font-size: 20px;

            background-color: #fff;

            border: none;

            color: #14A083;

        }


        form {

            margin-bottom: 20px;

        }


        h1 {

            margin: 0 0 5px;

            line-height: 1;

        }


        p {

            margin: 15px 0 0;

        }

        

        input {

            display: block;

            width: 100%;

            margin-bottom: 20px;

            padding: 10px;

            font-size: 15px;

            text-align: center;

        }


        .output {

            margin: 10px 0;

        }


        button {

            background-color: #14A083;

            color: #fff;

            border: none;

            border-radius: 2px;

            text-align: center;

            text-transform: uppercase;

            text-decoration: none;

            cursor: pointer;

            font-size: 15px;

            padding: 15px 10px;

            width: 100%;

            display: block;

            margin: 20px 0 0;

        }

    </style>

</head>

<body>

<div class="container">

        <div class="title">

            <h1>Feet To Inches In PHP</h1>

            <p>Created By:</p>

            <h2>&#187; Jake R. Pomperada, MAED-IT, MIT &#171;</h2>

        </div>

        <div class="wrapper">

            <form action="" method="post">

                <label>Enter a number here</label>

                <input type="number" name="txtValueInFeet" required>


                <button type="submit" name="btnSubmit">Convert</button>

            </form>

            <?php echo $value_in_inches;?>

        </div>

    </div>

</body>

</html>

Wednesday, January 12, 2022

Present Date in C

Present Date in C

 A simple program that I wrote to display the present date using a 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.






Program Listing

#include <stdio.h> #include <time.h> /* Jake Rodriguez Pomperada, MAED-IT, MIT www.jakerpomperada.com and www.jakerpomperada.blogspot.com jakerpomperada@gmail.com */ const char *month_names[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; int main() { time_t now = time(NULL); struct tm *day = localtime(&now); printf("\n\n"); printf("\tPresent Date in C"); printf("\n\n"); printf("\tDate : %s\t%d, %d", month_names[day->tm_mon], day->tm_mday,day->tm_year+1900); printf("\n\n"); printf("\tEnd of Program"); printf("\n\n"); return 0; }

Tuesday, January 11, 2022

Current Date in C++

Current Date in C++

 A program that will display the current date 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 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.






Program Listing

#include <iostream> #include <ctime> using std::string; int main() { time_t t = time(NULL); tm* timePtr = localtime(&t); std::cout <<"\n"; std::cout << "\tCurrent Date in C++\n"; std::cout <<"\n"; std::cout << "The Current Date : " <<(timePtr->tm_mday)<<"/"<< (timePtr->tm_mon)+1 <<"/"<< (timePtr->tm_year)+1900<<std::endl; return 0; }

Monday, January 10, 2022

Two Decimal Places in C

Two Decimal Places in C

 A simple program that demonstrates how to declare two decimal places using a 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.





Program Listing


#include <stdio.h>


  int main() {

 

        float temperature = 123.3567;


        printf("\n");

        printf("\tTwo Decimal Places in C");

        printf("\n\n");

        printf("\tThe temperature is %.2f degree's Celsius.",temperature);

        printf("\n\n");

        printf("\tEnd of Program");

        printf("\n");

        return 0;

  }


Sunday, January 9, 2022

Feet To Inches in C++

Feet To Inches in C++

  A simple program to ask the user to give a value in feet and then the program will convert the given feet into inches equivalent using a 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.





Program Listing

#include <iostream>

#include <iomanip>


using std::string;


  int main() {

 

        float feet=0.00, inches=0.00;

        

        std::cout <<"\n";

        std::cout <<"\tFeet To Inches in C++";

        std::cout <<"\n\n";

        std::cout <<"\tGive the number of feet : ";

        std::cin >> feet;

      std::cout <<"\n";

       

        inches = feet * 12.0;

        

        std::cout << std::fixed;

        std::cout << std::setprecision(2);

        std::cout <<"\t" << feet << " feet is equal to " << inches 

<< " inches." <<"\n";

        std::cout <<"\n";

        std::cout <<"\tEnd of Program";

        std::cout <<"\n";

        return 0;

  }


Feet To Inches in C

Feet To Inches in C

 A simple program to ask the user to give a value in feet and then the program will convert the given feet into inches equivalent using a 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.





Program Listing


#include <stdio.h>


  int main() {

 

        float feet=0.00, inches=0.00;


        printf("\n");

        printf("\tFeet To Inches in C");

        printf("\n\n");

        printf("\tGive the number of feet : ");

        scanf("%f", &feet);

  printf("\n");

       

        inches = feet * 12.0;

        

        printf("\t%.2f feet is equal to %.2f inches\n", feet, inches);

        printf("\n");

        printf("\tEnd of Program");

        printf("\n");

        return 0;

  }


Saturday, January 8, 2022

Multiplication Table in Java

Multiplication Table in Java

 Machine Problem

Write a program to generate a multiplication table 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.





Program Listing

public class Multiplication_Table {
public static void main(String[] args) {

        int Table_Size = 10;

      Display(Table_Size);
    }
   
    public static void Display(int Table_Size) {
   
    System.out.println();
        System.out.print("\t\t MULTIPLICATION TABLE IN JAVA ");
        System.out.print("\n\n");
        System.out.format("      ");

        for(int i = 0; i<=Table_Size ;i++ ) {

            System.out.format("%4d",i);

        }

        System.out.println();

       System.out.println(" -------------------------------------------------");

        
        for(int i = 0 ;i<=Table_Size ;i++) {

             System.out.format("%4d |",i);

            for(int j=0;j<=Table_Size ;j++) {

                System.out.format("%4d",i*j);

            }

            System.out.println();

        }
   System.out.println();
   System.out.println("\t\t END OF PROGRAM");     
   System.out.println("\n\n");

}
}

Present Month in Java

Present Month in Java

 Machine Problem

Write a program that will display the present month 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.






Solution


import java.time.*;


/**

 * @version January 5, 2021

 * @author Jake Rodriguez Pomperada, MAED-IT, MIT

 */

public class Calendar

{

   public static void main(String[] args)

   {

      LocalDate date = LocalDate.now();

      int month = date.getMonthValue();

      int today = date.getDayOfMonth();


      date = date.minusDays(today - 1); // set to start of month

      DayOfWeek weekday = date.getDayOfWeek();

      int value = weekday.getValue(); // 1 = Monday, . . . , 7 = Sunday


      System.out.println("\n");

  System.out.println("\tPresent Month in Java");

  System.out.println("\n");

  System.out.print("Month of January 2022");

  System.out.println("\n");

      System.out.println("Mon Tue Wed Thu Fri Sat Sun");

      for (int i = 1; i < value; i++)

         System.out.print("    ");

      while (date.getMonthValue() == month)

      {

         System.out.printf("%3d", date.getDayOfMonth());

         if (date.getDayOfMonth() == today)

            System.out.print("*");

         else

            System.out.print(" ");

         date = date.plusDays(1);

         if (date.getDayOfWeek().getValue() == 1) System.out.println();

      }

      if (date.getDayOfWeek().getValue() != 1) System.out.println();

   }

}


Input Your Name and Age in Java