Monday, February 8, 2021

Login System in VB.NET and MySQL

 I wrote this program that will ask the user to give username and password to check if the user is valid user or not the system using VB.NET and MySQL.

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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.








Program Listing


loginusers.sql


-- phpMyAdmin SQL Dump

-- version 4.0.4.1

-- http://www.phpmyadmin.net

--

-- Host: 127.0.0.1

-- Generation Time: Feb 08, 2021 at 07:09 AM

-- Server version: 5.6.11

-- PHP Version: 5.5.1


SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";

SET time_zone = "+00:00";



/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;

/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;

/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;

/*!40101 SET NAMES utf8 */;


--

-- Database: `login`

--


-- --------------------------------------------------------


--

-- Table structure for table `loginusers`

--


CREATE TABLE IF NOT EXISTS `loginusers` (

  `id` int(11) NOT NULL AUTO_INCREMENT,

  `username` varchar(100) NOT NULL,

  `password` varchar(100) NOT NULL,

  PRIMARY KEY (`id`)

) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;


--

-- Dumping data for table `loginusers`

--


INSERT INTO `loginusers` (`id`, `username`, `password`) VALUES

(1, '123', '123'),

(2, 'admin', 'admin'),

(3, 'jake', 'jake'),

(4, 'iya', 'iya'),

(5, 'allie', 'allie'),

(6, 'jacob', 'jacob');


/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;

/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;



Imports MySql.Data.MySqlClient

Public Class Form1
    Dim connection As New MySqlConnection("datasource=localhost;port=3306;username=root;password=;database=login")

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Me.Close()
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim command As New MySqlCommand("SELECT username,password FROM loginusers WHERE username = @username AND password = @password", connection)

        command.Parameters.Add("@username", MySqlDbType.VarChar).Value = TextBox1.Text
        command.Parameters.Add("@password", MySqlDbType.VarChar).Value = TextBox2.Text


        Dim adapter As New MySqlDataAdapter(command)
        Dim table As New DataTable()

        adapter.Fill(table)

        If table.Rows.Count = 0 Then

            MessageBox.Show("Invalid Username Or Password. Try Again")
            TextBox1.Text = ""
            TextBox2.Text = ""
            TextBox1.Focus()

        Else

            MessageBox.Show("Login Successfully")


            Form2.Show()
            Me.Hide()

        End If

    End Sub
End Class


Thursday, February 4, 2021

Display Records Using Date Picker in VB NET and MySQL

Display Records Using Date Picker in VB.NET and MySQL

 In this tutorial I will share with you how to display records from database using Date Picker of VB.NET and MySQL.

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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.





Program Listing


' Mr. Jake Rodriguez Pomperada, MAED-IT, MIT
' www.jakerpomperada.com and jakerpomperada.blogspot.com
' jakerpomperada@gmail.com
' Bacolod City,Negros Occidental Philippines
' Tools :  Microsoft Visual Studio 2015 Professional Edition
'          MySQL for Visual Studio Version 1.2.9

Imports MySql.Data.MySqlClient
Public Class Form1

    Dim connection As New MySqlConnection("datasource=localhost;port=3306;username=root;password=;database=users")

    Private Sub Search_Data_In_MySQL_Between_2_Date_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        Dim table As New DataTable()
        Dim adapter As New MySqlDataAdapter("SELECT * FROM personnel", connection)

        adapter.Fill(table)

        DataGridView1.DataSource = table

    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim table As New DataTable()
        Dim command As New MySqlCommand("SELECT * FROM personnel WHERE dob BETWEEN @d1 AND @d2", connection)

        command.Parameters.Add("@d1", MySqlDbType.Date).Value = DateTimePicker1.Value
        command.Parameters.Add("@d2", MySqlDbType.Date).Value = DateTimePicker2.Value

        Dim adapter As New MySqlDataAdapter(command)

        adapter.Fill(table)

        DataGridView1.DataSource = table

    End Sub


End Class


users.sql

-- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Feb 04, 2021 at 05:31 AM
-- Server version: 5.6.11
-- PHP Version: 5.5.1

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `users`
--
CREATE DATABASE IF NOT EXISTS `users` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `users`;

-- --------------------------------------------------------

--
-- Table structure for table `personnel`
--

CREATE TABLE IF NOT EXISTS `personnel` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(200) NOT NULL,
  `email` varchar(200) NOT NULL,
  `dob` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;

--
-- Dumping data for table `personnel`
--

INSERT INTO `personnel` (`id`, `name`, `email`, `dob`) VALUES
(1, 'Jake', 'jakerpomperada@gmail.com', '2021-02-01'),
(2, 'Jacob', 'jacob@gmail.com', '2021-02-02'),
(3, 'Julianna', 'julianna@gmail.com', '2021-02-03'),
(4, 'Ma. Junallie', 'allie@yahoo.com.ph', '2021-02-04'),
(5, 'Lydia', 'lydia@gmail.com', '2021-02-06'),
(6, 'virgilio', 'vir@hotmail.com', '2021-02-07'),
(7, 'Jun', 'jun@gmail.com', '2021-03-01'),
(8, 'Sally', 'sally@yahoo.com', '2021-02-14'),
(9, 'James', 'james@gmail.xcom', '2021-04-15'),
(10, 'Mario', 'mario@yahoo.com', '2021-03-23');

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;




Wednesday, February 3, 2021

Average, Sum, and Product in Java Using BigDecimal

Average, Sum, and Product in Java Using BigDecimal

 Write a Java program to solve the average, sum and product of three numbers using double data type and big decimal.

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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.






Program Listing


import java.util.Scanner;

import java.math.*; 


/**

 * @author Jake R. Pomperada, MAED-IT, MIT

 * www.jakerpomperada.com and www.jakerpomperada.blogspot.com

 * jakerpomperada@gmail.com

 * Bacolod City, Negros Occidental Philippines

 *

 */

public class AddTwoNumbers {


/**

* @param args

*/

public static void main(String[] args) {

// TODO Auto-generated method stub

   

   Scanner scan = new Scanner(System.in);

 

        BigDecimal avg,add,multiply; 

     

        Double avg_display,add_display,multiply_display; 

      

         

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

        System.out.println("\tAverage, Sum, and Product in Java Using BigDecimal");

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

        System.out.print("\tEnter the First number: ");

        double num1 = scan.nextDouble();

        System.out.print("\tEnter the Second number: ");

        double num2 = scan.nextDouble();

        System.out.print("\tEnter the Third number: ");

        double num3 = scan.nextDouble();

        scan.close();

      

        avg = new BigDecimal(average(num1, num2, num3)); 

      add =  new BigDecimal(sum(num1, num2, num3));

      multiply =  new BigDecimal(product(num1, num2, num3));

        

      avg_display = avg.doubleValue();

        add_display = add.doubleValue();

        multiply_display = multiply.doubleValue();

        

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

        System.out.print("\tAverage of these numbers :" 

        + avg_display + "\n");

        System.out.print("\tSum of these numbers :" 

            +  add_display+"\n");

        System.out.print("\tProduct of these numbers :" 

            +  multiply_display+"\n");

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

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

        System.out.println();

}


public static double average(double a, double b, double c)

    {

        return (a + b + c) / 3;

    }

 

public static double sum(double a, double b, double c)

    {

        return (a + b + c);

    }

 

public static double product(double a, double b, double c)

    {

        return (a * b * c);

    }

}



Loan Solver in Ruby

Loan Solver in Ruby

 Create a program that will ask the user the principal amount, the number of years, and interest rate of the loan of the customer, and then the program will compute the interest amount to be paid by the customer and display the result on the screen.

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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.




Program Listing

# loan.rb
# Written By Mr. Jake Rodriguez Pomperada,BSCS,MAED-IT
# Tools : Ruby 2.6.3 and Sublime Text Editor 
# May 13, 2019    Monday   9:58 PM
# Bacolod City, Negros Occidental
# Website       : http://www.jakerpomperada.com
# Email Address : jakerpomperada@gmail.com

puts "\n\n"
print "\tLoan Interest Solver";
puts "\n\n"
print "\tEnter Principal Amount PHP  : ";
principal = gets;
print "\tEnter No. of Years          : ";
time = gets;
print "\tEnter Percent Rate %        : ";
rate = gets;

principal = principal.to_f;
time = time.to_f;
rate = rate.to_f;

solve_interest = (principal * time * rate) / 100;

print "\n\n";
print "\tDISPLAY RESULTS";
print "\n\n";
print "\tThe total interest is PHP %.2f for #{time} year(s)." % solve_interest;
puts "\n\n";
print "\tEnd of Program";
puts "\n";

Remove Vowels in Modern C++

Remove Vowels Using Modern C++

 Machine Problem in C++

 Write a program to ask the user to give a string and then the program will remove the vowels in the given  string using the Modern C++ approach.

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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.




Program Listing


// vowel.cpp

// Machine Problem in C++

//

// Write a program to ask the user to give a string and

// then the program will remove the vowels in the given

// string using the Modern C++ approach.

//

// Mr. Jake R. Pomperada,MAED-IT,IT

// www.jakerpomperada.com and www.jakerpomperada.blogspot.com

// jakerpomperada@gmail.com

// Bacolod City, Negros Occidental Philippines

 


#include <iostream>

#include <string>



int main()

{

std::string str;

int a=0,b=0,len=0;

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

std::cout <<"\tRemove Vowels Using Modern C++";

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

std::cout<<"\tGive a String : ";

std::getline(std::cin,str);

len=str.length();

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

std::cout <<"\tDISPLAY RESULTS";

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

std::cout<<"\tThe Original String : "<<str;

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

for(a=0; a<len; a+=1)

{   


if(str[a]=='a'||str[a]=='e'||str[a]=='i'||str[a]=='o'

||str[a]=='u'||str[a]=='A'||str[a]=='E'||str[a]=='I'||

str[a]=='O'||str[a]=='U')

{

    

for(b=a; b<len; b+=1)

{


str[b]=str[b+1];

}

len=len-1;;

}

}

std::cout<<"\tThe Remaining String : "<<str;

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

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

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

}



Tuesday, February 2, 2021

Basic Math Operations in PHP Using Drop Down Menu

Basic Math Operations in PHP using Drop Down Menu

 A simple php program to perform basic math operations using addition, subtraction, multiplication and division by asking the user to give two numbers and select the operations using drop-down menu in HTML.

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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.









Program Listing

<?php 
    $num1 = $num2 = $oper = $answer = $infotext = "";

    if(isset($_POST['btnSolve'])) 
    { 
        $num1   = $_POST['txtNum1'];
        $num2   = $_POST['txtNum2'];
        $oper   = $_POST['txtOper'];

        switch ($oper) {
            case "Addition":
                $answer = $num1 + $num2;
                $infotext = $num1." + ".$num2;
                break;
            case "Subtraction":
                $answer = $num1 - $num2;
                $infotext = $num1." - ".$num2;
                break;
            case "Multiplication":
                $answer = $num1 * $num2;
                $infotext = $num1." x ".$num2;
                break;
            case "Division":
                $answer = $num1 / $num2;
                $infotext = $num1." / ".$num2;
                break;
        }

        $answer='<div class="answer">'.$infotext.' = '.$answer.'</div>';
    }
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Basic Math Operations in PHP Using Drop Down Menu</title>
        <link rel="stylesheet" href="style.css">
    </head>
    <body>          
        <h3 align="center"> Basic Math Operations in PHP Using Drop Down Menu</h3>
        <main>
            <div class="container">
                <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
                    <label for="txtNum1"><b>First Number:</b></label>
                    <input type="number" name="txtNum1" id="txtNum1" value="<?php echo $num1; ?>" required>

                    <label for="txtNum2"><b>Second Number:</b></label>
                    <input type="number" name="txtNum2" id="txtNum2" value="<?php echo $num2; ?>" required>

                    <label for="txtOper"><b>Select Operator:</b></label>
                    <select name="txtOper" id="txtOper" value="<?php echo $oper; ?>" required>
                        <option value="Addition">Addition</option>
                        <option value="Subtraction">Subtraction</option>
                        <option value="Multiplication">Multiplication</option>
                        <option value="Division">Division</option>
                    </select>

                    <button type="submit" name="btnSolve" class="btnSolve">Solve</button>

                    <?php echo $answer;?>
                </form>
            </div>
        </main>
    </body>
</html>

style.css

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #fefefe;
    color: #1a1a1a;
    font-size: 15px;
}

main {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 450px;
    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
    border-radius: 10px;
}

.container {
    display: block;
    padding: 30px;
    background: #fff;
    text-align: left;
    border-radius: 2px;
}

input,
select {
    display: inline-block;
    background: #f5f5f5;
    width: 100%;
    margin: 5px 0 20px 0;
    padding: 15px;
    border: none;
    font-size: 15px;
}

input:focus,
select:focus {
    background: #eeeeee;
    outline: none;
}

button {
    background: #2196f3;
    color: #fff;
    padding: 10px 20px;
    margin: 10px 0 0;
    border: none;
    cursor: pointer;
    width: 100%;
    opacity: 0.9;
    text-transform: uppercase;
    font-size: 15px;
    outline: none;
}

button:hover {
    opacity: 1;
}

.answer {
    padding: 20px;
    margin-top: 20px;
    text-align: center;
    font-size: 30px;
    font-weight: bold;
    background: #dadada;
}




Area of Shapes in PHP

Area of Shapes (Rectangle, Triangle, and Circle) in PHP

Machine Problem in PHP

Create a PHP program that will help the USERS to compute the area of a rectangle, triangle, and circle. Use functions in creating the program. Apply CSS to have an appealing program. Expected outputs: *must have an input box for measurements *the program will ask the user if it's a rectangle, triangle, or circle (use a dropdown list) *displays the correct area *button/s that will compute the area.

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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.







Program Listing

style.css

* { box-sizing: border-box; } body { font-family: Arial, Helvetica, sans-serif; background: #fefefe; color: #1a1a1a; font-size: 15px; } main { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 500px; box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; border-radius: 10px; } .container { display: block; padding: 30px; background: #fff; text-align: left; border-radius: 2px; } h2 { text-align: center; } label { width: 100%; font-size: 20px; } input, select { display: inline-block; background: #f5f5f5; width: 100%; margin: 5px 0 20px 0; padding: 15px; border: none; font-size: 15px; } input:focus, select:focus { background: #eeeeee; outline: none; } button { background: #2196f3; color: #fff; padding: 15px; margin: 0 0 20px; border: none; cursor: pointer; width: 100%; opacity: 0.9; font-size: 15px; outline: none; } .btnSelectShape { background: #f44336; } button:hover { opacity: 1; } .answer { width: 100%; padding: 20px; text-align: center; font-size: 30px; font-weight: bold; background: #dadada; font-family: 'Times New Roman', serif; line-height: 1.5; } .visibility_on { display: block; } .visibility_off { display: none; } .frmAreaSelect { display: flex; flex-flow: row wrap; align-items: center; } .frmAreaSelect select { vertical-align: middle; padding: 15px; margin: 5px 0 0; width: calc(100% - 100px); } .frmAreaSelect button { width: 100px; margin: 5px 0 0; } .pieText { font-family: Serif; }


index.php

<?php /* Area of Shapes (Rectangle, Triangle, and Circle) in PHP Author : Jake Rodriguez Pomperada, MAED-IT, MIT www.jakerpomperada.com and www.jakerpomperada.blogspot.com jakerpomperada@gmail.com Bacolod City, Negros Occidental Philippines */ $area = $html = $infotext = $sel1 = $sel2 = $sel3 = ""; $num1 = isset($_POST['txtNum1']) ? floatval($_POST['txtNum1']) : ""; $num2 = isset($_POST['txtNum2']) ? floatval($_POST['txtNum2']) : ""; $visibility = "visibility_off"; $frmArea = isset($_GET['selectArea']) ? $_GET['selectArea'] : ''; // Display selected shape input fields if(isset($_GET['selectArea'])) { $visibility = "visibility_on"; switch ($frmArea) { case "Rectangle": $sel1 = "selected"; $html = '<h2>Area of a Rectangle ( l x w )</h2> <label for="txtNum1"><b>Length (l):</b></label> <input type="number" step=".0001" name="txtNum1" id="txtNum1" value="'.$num1.'" required> <label for="txtNum2"><b>Width (w):</b></label> <input type="number" step=".0001" name="txtNum2" id="txtNum2" value="'.$num2.'" required>'; if(isset($_POST['btnCalculate'])) { $area = round($num1 * $num2); $infotext = '<div class="answer">'.$num1." x ".$num2." = ".$area."</div>"; } break; case "Triangle": $sel2 = "selected"; $html = '<h2>Area of a Triangle ( <sup>bh</sup>&frasl;<sub>2</sub> )</h2> <label for="txtNum1"><b>Base (b):</b></label> <input type="number" step=".0001" name="txtNum1" id="txtNum1" value="'.$num1.'" required> <label for="txtNum2"><b>Height (h):</b></label> <input type="number" step=".0001" name="txtNum2" id="txtNum2" value="'.$num2.'" required>'; if(isset($_POST['btnCalculate'])) { $area = round(($num1 * $num2)/2); $infotext = '<div class="answer"><sup>('.$num1." x ".$num2.")</sup>&frasl;<sub>2</sub> = ".$area."</div>"; } break; case "Circle": $sel3 = "selected"; $html = '<h2>Area of a Circle ( <span class="pieText">Ï€</span>r<sup>2</sup> )</h2> <label for="txtNum1"><b>Radius (r):</b></label> <input type="number" step=".0001" name="txtNum1" id="txtNum1" value="'.$num1.'" required>'; if(isset($_POST['btnCalculate'])) { $area = round((pi() * pow($num1, 2)), 4); $infotext = '<div class="answer"><span class="pieText">Ï€</span>('.$num1.')<sup>2</sup> = '.$area.'</div>'; } break; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Area of Shapes (Rectangle, Triangle, and Circle) in PHP</title> <link rel="stylesheet" href="style.css"> </head> <body> <h3 align="center"> Area of Shapes (Rectangle, Triangle, and Circle) in PHP </h3> <main> <div class="container"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get" class="frmAreaSelect"> <label for="selectArea"><b>Select Shape:</b></label> <select name="selectArea" id="selectArea" value="<?php echo $oper; ?>" required> <option value="Rectangle" <?php echo $sel1; ?>>Rectangle</option> <option value="Triangle" <?php echo $sel2; ?>>Triangle</option> <option value="Circle" <?php echo $sel3; ?>>Circle</option> </select> <button type="submit" class="btnSelectShape">Select</button> </form> </div> <div class="container <?php echo $visibility; ?>"> <form action="" method="post" class="frmAreaCalculate"> <?php echo $html; ?> <button type="submit" name="btnCalculate" class="btnCalculate">Calculate Area</button> <?php echo $infotext; ?> </form> </div> </main> </body> </html>


Monday, February 1, 2021

Odd and Even Number in Modern C++

Odd and Even Numbers in Modern C++

 Machine Problem in C++

Write a program to ask the user to give a number and then the program will check if the given number

is odd or even number.

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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.





Program Listing

// odd_even.cpp

// Machine Problem in C++

// Write a program to ask the user to give a number

// and then the program will check if the given number

// is odd or even number.

//

//  Mr. Jake Rodriguez Pomperada, MAED-IT, MIT

//  www.jakerpomperada.com  and www.jakerpomperada.blogspot.com

//  jakerpomperada@gmail.com

//  Bacolod City, Negros Occidental Philippines

//  February 1, 2021   Monday   2:09 PM



#include <iostream>


int main() {

   

   int num=0;

   

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

   std::cout <<"\tOdd and Even Numbers in Modern C++";

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

   std::cout <<"\tGive a Number : ";

   std::cin >> num;

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

    if(num % 2 == 0) {

  std::cout<<"\tThe given number "<< num<<" is even number.";

   }

   else {

  std::cout<<"\tThe given number "<< num<<" is odd number.";

  }

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

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

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

   

}