Monday, January 21, 2019

Mass and Time Converter in C#

A very simple menu driven program written in C# to convert mass and time.

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Mass_Time_Converter
{
    class Program
    {
        static void Main(string[] args)
        {
            bool repeat = true;
            int num;
            int num1;
            int con;
            while (repeat)
            {
                Console.WriteLine("\n");
                Console.WriteLine("\t===== MAIN MENU =====");
                Console.WriteLine("\n");
                Console.WriteLine("\tSelect one to convert")
                Console.WriteLine("\n");
                Console.WriteLine("\t[1] Mass Conversion");
                Console.WriteLine("\t[2] Time Conversion");
                Console.WriteLine("\n");
                Console.Write("\tYou choose: ");
                con = Convert.ToInt32(Console.ReadLine());
                if (con == 1)
                {
                    Console.WriteLine("\tConvert Mass");
                    Console.WriteLine("\t1. Kilograms to Grams");
                    Console.WriteLine("\t2. Grams to Miligrams");
                    Console.WriteLine("\t3. Milligrams to Micrograms");
                    Console.WriteLine("\n");
                    Console.Write("\tYou choose what to convert: ");
                    num = Convert.ToInt32(Console.ReadLine());
                    if (num == 1)
                    {
                        Console.Write("\tEnter Number: ");
                        num1 = Convert.ToInt32(Console.ReadLine());
                        int ans = num1 * 1000;
                        Console.WriteLine(+num1 + " kilogram/s is equivalent to " + ans + " gram/s.");
                        Console.WriteLine("\tDo you want to convert again?");
                        Console.WriteLine("\n");
                        Console.WriteLine("\tContinue Yes or No?");
                        string ask = Console.ReadLine();
                        if (ask.ToLower() != "yes")
                        {
                            repeat = false;
                            Console.WriteLine("\tThank you for using this software.");
                        }
                    }
                    else if (num == 2)
                    {
                        Console.Write("\tEnter Number: ");
                        num1 = Convert.ToInt32(Console.ReadLine());
                        int ans1 = num1 * 1000;
                        Console.WriteLine(+num1 + " gram/s is equivalent to " + ans1 + " milligram/s.");
                        Console.WriteLine("\tDo you want to convert again?");
                        Console.WriteLine("\n");
                        Console.WriteLine("\tContinue Yes or No?");
                        string ask = Console.ReadLine();
                        if (ask.ToLower() != "yes")
                        {
                            repeat = false;
                            Console.WriteLine("Thank you!");
                        }
                    }
                    else if (num == 3)
                    {
                        Console.Write("\tEnter Number: ");
                        num1 = Convert.ToInt32(Console.ReadLine());
                        int ans2 = num1 * 1000;
                        Console.WriteLine(+num1 + " milligram/s is equivalent to " + ans2 + " microgram/s.");
                        Console.WriteLine("\tDo you want to convert again?");
                        Console.WriteLine("\n");
                        Console.WriteLine("\tContinue Yes or No?");
                        string ask = Console.ReadLine();
                        if (ask.ToLower() != "yes")
                        {
                            repeat = false;
                            Console.WriteLine("\tThank you for using this Software");
                        }
                    }
                    else
                    {
                        Console.WriteLine("\tError! Operation Not Found!");
                        Console.WriteLine("\tDo you want to convert again?");
                        Console.WriteLine("\tContinue Yes or No?");
                        string ask = Console.ReadLine();
                        if (ask.ToLower() != "yes")
                        {
                            repeat = false;
                            Console.WriteLine("\tThank you!");
                        }
                    }
                }

                else if (con == 2)
                {
                    Console.WriteLine("Choose what to convert");
                    Console.WriteLine("1. Minutes to Seconds");
                    Console.WriteLine("2. Hours to Minutes");
                    Console.WriteLine("3. Days to Hours");
                    Console.Write("You choose what to convert: ");
                    num = Convert.ToInt32(Console.ReadLine());
                    if (num == 1)
                    {
                        Console.Write("Enter Number: ");
                        num1 = Convert.ToInt32(Console.ReadLine());
                        int ans3 = num1 * 60;
                        Console.WriteLine(+num1 + " minute/s is equivalent to " + ans3 + " second/s.");
                        Console.WriteLine("Do you want to convert again?");
                        Console.WriteLine("Yes or No?");
                        string ask = Console.ReadLine();
                        if (ask.ToLower() != "yes")
                        {
                            repeat = false;
                        }
                        else
                        {
                            Console.WriteLine("Thank you!");
                            Console.ReadKey();
                        }
                    }
                }
            }
        }
    }
}






AC Bulb Lights on and Lights Off in Arduino

A simple Arduino application that I wrote and construct that will allow us to turn on and off our alternating current bulb using Arduino UNO and 5 volts Relay.  I hope you will find my work useful. Thank you.

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

/*  AC Bulb Lights on and Lights Off in Arduino
 *   Written By Mr. Jake R. Pomperada
 *   January 20, 2019  Sunday, Bacolod City, Negros Occidental Philippines
 *   8:54 AM
 */

#define RELAY1  7                        

void setup()

{    


Serial.begin(9600);
  pinMode(RELAY1, OUTPUT);       

}

  void loop()

{

   digitalWrite(RELAY1,0);           // Turns ON Relays 1
   Serial.println("Light ON");
   delay(2000);                     // Wait 2 seconds

   digitalWrite(RELAY1,1);          // Turns Relay Off
   Serial.println("Light OFF");
   delay(2000);
   
}



Friday, January 18, 2019

Knight Rider LED Light Chaser in Arduino

A simple application that I wrote in C language in Arduino to show the Knight Rider LED Light Chaser I am using Arduino UNO in this project activity.

I hope you will find my work useful. Thank you.

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

/*  Knight Right LED Light Chaser
 *  Written By: Mr. Jake R. Pomperada, MAED-IT
 *  January 18, 2019   10:20 PM Friday
 *  http://www.jakerpomperada.com
 *  jakerpomperada@gmail.com and jakerpomperada@yahoo.com
 */

int pin2 = 2;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int pin6 = 6;
int pin7 = 7;
int timer = 40;

void setup(){
  pinMode(pin2, OUTPUT);
  pinMode(pin3, OUTPUT);
  pinMode(pin4, OUTPUT);
  pinMode(pin5, OUTPUT);
  pinMode(pin6, OUTPUT);
  pinMode(pin7, OUTPUT);
}

void loop() {
   digitalWrite(pin2, HIGH);
   delay(timer);
   digitalWrite(pin2, LOW);
   delay(timer);

   digitalWrite(pin3, HIGH);
   delay(timer);
   digitalWrite(pin3, LOW);
   delay(timer);

   digitalWrite(pin4, HIGH);
   delay(timer);
   digitalWrite(pin4, LOW);
   delay(timer);

   digitalWrite(pin5, HIGH);
   delay(timer);
   digitalWrite(pin5, LOW);
   delay(timer);

   digitalWrite(pin6, HIGH);
   delay(timer);
   digitalWrite(pin6, LOW);
   delay(timer);

   digitalWrite(pin7, HIGH);
   delay(timer);
   digitalWrite(pin7, LOW);
   delay(timer);

   digitalWrite(pin6, HIGH);
   delay(timer);
   digitalWrite(pin6, LOW);
   delay(timer);

   digitalWrite(pin5, HIGH);
   delay(timer);
   digitalWrite(pin5, LOW);
   delay(timer);

   digitalWrite(pin4, HIGH);
   delay(timer);
   digitalWrite(pin4, LOW);
   delay(timer);

   digitalWrite(pin3, HIGH);
   delay(timer);
   digitalWrite(pin3, LOW);
   delay(timer);
}




Login Security System Using Visual Basic NET and MySQL

A simple program that I wrote that show you how to create login security using Visual Basic NET and MySQL as our database.

I hope you will find my work useful. Thank you.

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

Imports MySql.Data.MySqlClient

Public Class Form1
    Dim cmd As New MySqlCommand
    Dim da As New MySqlDataAdapter
    Dim con As MySqlConnection = conn()

    Public Function conn() As MySqlConnection
        Return New MySqlConnection("server=localhost;user id=root;password=;database=studentdb")
    End Function
    Private Sub btnlogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlogin.Click
        Dim sql As String
        Dim publictable As New DataTable
        Try
            If txtuname.Text = "" And txtpass.Text = "" Then
                MsgBox("Password or Username Textbox Cannot be Empty.", vbCritical, "Remainder")
                txtuname.Text = ""
                txtpass.Text = ""
                txtuname.Focus()
            Else
                sql = "select * from tbluseraccounts where username ='" & txtuname.Text & "' and userpassword = '" & txtpass.Text & "'"
                With cmd
                    .Connection = con
                    .CommandText = sql
                End With
                da.SelectCommand = cmd
                da.Fill(publictable)
                If publictable.Rows.Count > 0 Then
                    Dim user_type, name As String
                    user_type = publictable.Rows(0).Item(4)
                    name = publictable.Rows(0).Item(2)
                    If user_type = "Admin" Then
                        MsgBox("Welcome " & name & " you login as Administrator ", vbInformation, "Welcome")
                        lbllogin.Text = "Logout"
                        GroupBox1.Enabled = False
                        txtuname.Text = ""
                        txtpass.Text = ""
                        lblname.Font = New Font(lblname.Font, FontStyle.Bold)
                        lblname.Text = "Hi, " & UCase(name)

                    ElseIf user_type = "Encoder" Then
                        MsgBox("Welcome " & name & " you login as Encoder ", vbInformation, "Welcome")
                        lbllogin.Text = "Logout"
                        GroupBox1.Enabled = False
                        txtuname.Text = ""
                        txtpass.Text = ""
                        lblname.Font = New Font(lblname.Font, FontStyle.Bold)
                        lblname.Text = "Hi, " & UCase(name)
                    Else
                        MsgBox("You login as Guest!", vbInformation, "Welcome")
                        lbllogin.Text = "Logout"
                        GroupBox1.Enabled = False
                        txtuname.Text = ""
                        txtpass.Text = ""
                        lblname.Font = New Font(lblname.Font, FontStyle.Bold)
                        lblname.Text = "Hi, " & UCase(name)
                    End If

                Else
                    MessageBox.Show("Username or Password is Incorrect" & vbNewLine _
                       & vbNewLine _
                       & "Kindly try again please." & vbNewLine & vbNewLine _
                       & "Program developed By : Mr. Jake Rodriguez Pomperada" & vbNewLine _
                       , "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
                    txtuname.Text = ""
                    txtpass.Text = ""
                    txtuname.Focus()
                End If

                da.Dispose()
            End If

        Catch ex As Exception
            MsgBox(ex.Message)

        End Try
        con.Clone()

       
    End Sub

    Private Sub lbllogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbllogin.Click

        If lbllogin.Text = "Logout" Then
            lbllogin.Text = "Login"
            lblname.Text = "Hi, Guest!"
        ElseIf lbllogin.Text = "Login" Then
            GroupBox1.Enabled = True

        End If
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        GroupBox1.Enabled = False
        Dim toolTip1 As New ToolTip()
        toolTip1.ShowAlways = True
        toolTip1.SetToolTip(lbllogin, "Click here to login or logout to the system.")

    End Sub
End Class


studentdb.sql

-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 18, 2019 at 09:11 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.0

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: `studentdb`
--

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

--
-- Table structure for table `tbluseraccounts`
--

CREATE TABLE `tbluseraccounts` (
  `userID` int(11) NOT NULL,
  `username` varchar(255) DEFAULT NULL,
  `users_name` varchar(255) DEFAULT NULL,
  `userpassword` varchar(255) DEFAULT NULL,
  `usertype` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbluseraccounts`
--

INSERT INTO `tbluseraccounts` (`userID`, `username`, `users_name`, `userpassword`, `usertype`) VALUES
(1, 'admin', 'Jake R. Pomperada', 'admin', 'Admin'),
(2, 'jacob', 'Jacob Samue F. Pomperada', 'jacob', 'guest'),
(3, 'iya', 'Julianna Rae F. Pomperada', 'iya', 'Encoder');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `tbluseraccounts`
--
ALTER TABLE `tbluseraccounts`
  ADD PRIMARY KEY (`userID`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `tbluseraccounts`
--
ALTER TABLE `tbluseraccounts`
  MODIFY `userID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
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 */;