Wednesday, July 10, 2019

Square and Cube of a Number Solver Using Methods in Ruby


Write a program to ask the user to give an integer number and then the program will compute the square and cube numerical values of the given number and display the result on the result.

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.

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

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

 square_cure.rb


# square_cure.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 17, 2019   Monday 11:00 AM
# 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@gmai.com and jakerpomperada@yahoo.com

def square(a)
  return a * a;
end

def cube(b)
  return b * b * b;
end

puts "\n\n"
print "\tSquare and Cube of a Number Solver Using Methods";
puts "\n\n"
print "\tGive First Value  : ";
val1 = gets;

val1 = val1.to_i;
square_value = square_value.to_i;
cube_value =  cube_value.to_i;


square_value = square(val1);
cube_value = cube(val1);

print "\n\n";
print("\tThe square value of #{val1} is #{square_value}.\n\n")
print("\tThe cube value of #{val1} is #{cube_value}.\n")
puts "\n\n"
print "\tEnd of Program";
puts "\n"



Global Scope Resolution Operator in C++

In this article, I would like to share with you a sample program that I have learned in C++ programming about Global Scope Resolution Operator. This is very important if you are working on a C++ program especially you are dealing with advanced topics in C++ and object-oriented programming.

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.

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

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

scope.cpp


// Global Scope Resolution Operator in C++
// Jake R. Pomperada,MAED-IT
// July 8, 2019   8:20 PM
// Bacolod City, Negros Occidental Philippines

#include <iostream>

using namespace std;

int amt = 456;  // global variable declaration

int main()
{
int amt = 123;  // local variable declaration
cout <<"\n";
cout <<"\tGlobal Scope Resolution Operator in C++";
cout <<"\n\n";
cout << "\tDisplay Global Variable Value :" <<::amt;   // display global variable
cout <<"\n\n";
cout << "\tDisplay Local Variable Value :" << amt;   // display local variable
cout <<"\n\n";
cout <<"\tEnd of Program";
}





Tuesday, July 9, 2019

Leap Year Lister Using Two Dimensional Arrays in Ruby

Write a program using a two-dimensional array that will ask how many numbers of years to be processed and then the program will ask the user to give a series of years.  The program will check and determine which of the given year is a leap year or not a leap year and display the results 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 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.

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

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Sample Program Output

Program Listing

# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 2, 2019   Tuesday  10:54 AM
# 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@gmai.com and jakerpomperada@yahoo.com

require 'date'

puts "\n\n"
print "\tLeap Year Lister Using Two Dimensional Arrays";
puts "\n\n"
print "\tEnter number of elements :  ";
num_val = gets.chomp
num_val = num_val.to_i;

year = Array.new() { Array.new(0)}

print("\n")   
for number in (1..num_val)
  print "\tValue in Item No. #{number} : ";
  year[number] = gets.chomp
  year[number] = year[number].to_i;
 end
 print "\n";
 print "\t===== DISPLAY RESULT ====="
 print "\n\n";
for list_down in 1..num_val
    x = Date.leap?(year[list_down])
    if (x== true)
      print ("\tThe given year #{year[list_down]} is LEAP year.\n")
    else
      print ("\tThe given year #{year[list_down]} is NOT LEAP year.\n")
 end
end
print "\n";
print "\tEND OF PROGRAM";
print "\n\n";





Cube Numbers Using Two-Dimensional Arrays in Ruby

Write a program using a two-dimensional array to ask the user to give five numbers and then the program will compute the cube value of each given numbers and display the results 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 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.

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

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

# cube_array.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 29, 2019  Saturday  4:27 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@gmai.com and jakerpomperada@yahoo.com
puts "\n\n"
print "\tCube Numbers Using Two-Dimensional Arrays";
puts "\n\n"
val_items = Array.new(5) { Array.new(0)}
sum = 0;
sum = sum.to_i;

5.times do |x|
  print "\tGive value in item no. #{x+1} : "
  val_items[x] = gets.chomp
  val_items[x]  = val_items[x].to_i;
end

puts("\n");
print("\tNumber \t Cube Number Equivalent");
print "\n\n";
for i in val_items
  print("\t");
  print(" #{i} \t\t  #{i**3}\n")
end
    
print "\n";
print "\tEND OF PROGRAM";




Monday, July 8, 2019

CRUD in Visual Basic NET and MySQL

In this article, I would like to share with you an application that I wrote in Microsoft Visual Basic NET and MySQL I would like to thank my close friend, business partner, and fellow software engineer Mr.  Larry Lacapag Emol who help me understand how to create CRUD in VB.NET and MySQL.  Please install MySQL Net/connector 5.2 with MySQL Server 5.0 run in Visual Studio 2010 Express Edition before you run the code to avoid unnecessary errors in the program.

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.

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

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com





Sample Program Output


Program Listing


Public Class Form1
    Public Sub clear()
        Me.TextBox1.Text = ""
        Me.TextBox2.Text = ""
        Me.TextBox3.Text = ""
        Me.TextBox4.Text = ""
        Me.TextBox1.Focus()
    End Sub


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        connect()
        DS = New DataSet
        query = "Select * from tblInformation"
        DA = New MySql.Data.MySqlClient.MySqlDataAdapter(query, conn)
        DA.Fill(DS)

        DataGridView1.DataSource = DS.Tables(0)
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        cmd = New MySql.Data.MySqlClient.MySqlCommand
        cmd.Connection = conn

        query = "insert into tblInformation values('" & "" & "','" & UCase(TextBox1.Text) & "','" & UCase(TextBox2.Text) & "','" & UCase(TextBox3.Text) & "','" & TextBox4.Text & "')"
        cmd.CommandText = query
        cmd.ExecuteNonQuery()
        LoadData()
        MsgBox("Successfully Added", MsgBoxStyle.Information, "Save")
    End Sub

    Sub LoadData()
        DS = New DataSet
        query = "Select * from tblInformation"
        DA = New MySql.Data.MySqlClient.MySqlDataAdapter(query, conn)
        DA.Fill(DS)

        Me.DataGridView1.DataSource = DS.Tables(0)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        cmd = New MySql.Data.MySqlClient.MySqlCommand
        cmd.Connection = conn

        query = "update tblInformation set FIRSTNAME='" & UCase(TextBox1.Text) & "',MIDDLENAME='" & UCase(TextBox2.Text) & "',LASTNAME='" & UCase(TextBox3.Text) & "',AGE='" & TextBox4.Text & "' where ID='" & Me.TextBox5.Text & "'"
        cmd.CommandText = query
        cmd.ExecuteNonQuery()
        LoadData()
        MsgBox("Successfully Updated", MsgBoxStyle.Information, "Updated")
    End Sub

    Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
        Dim i As Integer
        i = DataGridView1.CurrentRow.Index

        Me.TextBox1.Text = DataGridView1.Item(1, i).Value
        Me.TextBox2.Text = DataGridView1.Item(2, i).Value
        Me.TextBox3.Text = DataGridView1.Item(3, i).Value
        Me.TextBox4.Text = DataGridView1.Item(4, i).Value
        Me.TextBox5.Text = DataGridView1.Item(0, i).Value
    End Sub

    
    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If MsgBox("Do you want to delete data", vbInformation + vbYesNo) = vbYes Then
            cmd = New MySql.Data.MySqlClient.MySqlCommand
            cmd.Connection = conn

            query = "Delete from tblInformation where ID='" & Me.TextBox5.Text & "'"
            cmd.CommandText = query
            cmd.ExecuteNonQuery()
            LoadData()
            MsgBox("Successfully Deleted", MsgBoxStyle.Information, "Deleted")
        End If
    End Sub


    Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox6.TextChanged
        Filterdata(TextBox6.Text)
    End Sub

    Sub Filterdata(ByVal valueToSearch As String)
        Dim searchQuery As String = "Select * from tblInformation where FIRSTNAME like '%" & Me.TextBox6.Text & "%' OR LASTNAME like '%" & Me.TextBox6.Text & "%' OR MIDDLENAME like '%" & Me.TextBox6.Text & "%'"

        Dim command As New MySql.Data.MySqlClient.MySqlCommand(searchQuery, conn)
        Dim adapter As New MySql.Data.MySqlClient.MySqlDataAdapter(command)
        Dim table As New DataTable()

        adapter.Fill(table)

        Me.DataGridView1.DataSource = table
    End Sub



    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        End
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Me.TextBox1.Text = ""
        Me.TextBox2.Text = ""
        Me.TextBox3.Text = ""
        Me.TextBox4.Text = ""
        Me.TextBox1.Focus()
    End Sub
End Class


tblinformation.sql

-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 08, 2019 at 08:13 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.1.28

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
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 utf8mb4 */;

--
-- Database: `tutorial`
--

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

--
-- Table structure for table `tblinformation`
--

CREATE TABLE `tblinformation` (
  `ID` int(11) NOT NULL,
  `FIRSTNAME` varchar(50) NOT NULL,
  `MIDDLENAME` varchar(50) NOT NULL,
  `LASTNAME` varchar(50) NOT NULL,
  `AGE` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblinformation`
--

INSERT INTO `tblinformation` (`ID`, `FIRSTNAME`, `MIDDLENAME`, `LASTNAME`, `AGE`) VALUES
(2, 'LARRY DAVE', 'LACAPAG', 'EMOL', '24'),
(3, 'JAKE', 'RODRIGUEZ', 'POMPERADA', '41'),
(5, 'MA. JUNALLIE ', 'FUENTEBELLA', 'POMPERADA', '47'),
(7, 'JACOB SAMUEL', 'FUENTEBELLA', 'POMPERADA', '6'),
(8, 'JULIANNA RAE', 'FUENTEBELLA', 'POMPERADADA', '5');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `tblinformation`
--
ALTER TABLE `tblinformation`
  ADD PRIMARY KEY (`ID`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `tblinformation`
--
ALTER TABLE `tblinformation`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
COMMIT;

/*!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 */;






Saturday, July 6, 2019

Sum of Three Numbers Using TypeScript

A simple program that I wrote using TypeScript to sum the values of the three numbers. The code is very simple and easy to understand.

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.

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

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output

Program Listing

// add.ts
// Author : Jake R. Pomperada
// Date   : July 6, 2019
// Language : Node.js and TypeScript

var num1:number = 5
var num2:number = 4
var num3:number = 1
var  sum:number =0

sum = (num1 + num2 + num3)

console.log("\n")
console.log("\tSum of Three Numbers Using TypeScript")
console.log("\n")
console.log("\tCreated By: Mr. Jake R. Pomperada")
console.log("\n")
console.log("\tValue No. 1 : " + num1)
console.log("\tValue No. 2 : " + num2)
console.log("\tValue No. 3 : " + num3)
console.log("\n")
console.log("\tThe total sum of three numbers is  "+sum); 


Friday, July 5, 2019

Addition of Three Numbers in ASP.NET

In this article, I would like to share with you a sample program to ask the user to give three numbers and then it will compute the total sum of the three numbers using ASP.NET I am using VB.NET in writing the codes in this program. I am using Visual Studio 2010 Express Edition as my tool.

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.

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

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com




Sample Program Output


Program Listing

Default.aspx.vb

Public Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        Dim a, b, c, sum As Integer

        a = Val(TextBox1.Text)
        b = Val(TextBox2.Text)
        c = Val(TextBox3.Text)

        sum = (a + b + c)

        TextBox4.Text = Val(sum)

    End Sub

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox1.Focus()
    End Sub
End Class