Thursday, December 14, 2017

Hello World in Ruby on Rails

In this article I would like to share with you a sample program that I wrote using Ruby on Rails framework to display hello world on the screen. The code is very easy to understand it uses MVC concepts and principles.

I am currently accepting programming and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.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 is (034) 4335675.




Sample Program Output


Program Listing

routes.rb

Rails.application.routes.draw do
  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
    root 'hello#index' 
end

application.html.erb

<!DOCTYPE html>
<html>
  <head>
    <title>Hello World</title>
    <%= csrf_meta_tags %>

    <%= stylesheet_link_tag    'default', media: 'all', 'data-turbolinks-track': 'reload' %>
    <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
  </head>

  <body>
    <%= yield %>
  </body>
</html>

index.html.erb

<html>
<title> Hello World in ROR </title>
<style>
  body {
  font-family: arial;
  font-size: 16px;
  background-color: lightgreen;
  }
</style>
<br>
<h1> Hello World in Ruby on Rails </h1>

<br>

<p> Created By Mr. Jake R. Pomperada 2017</p>

</h1>

</html>




Wednesday, December 13, 2017

Odd and Even Number Checker in Ruby

In this article I would like to share with you a sample program that will ask the user to give a number and then our program will check if the given number is an odd or even using Ruby as our programming language.

I am currently accepting programming and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.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 is (034) 4335675.



Sample Program Output

Program Listing

odd_even.rb

# odd_even.rb
# Written By: Mr. Jake R. Pomperada, MAED-IT
# December 13, 2017
# Tool : Ruby and Sublime Text Editor
# Location : Bacolod City, Negros Occidental Philippines

# method to check odd and even numbers

def check_odd_even(input_number)
    if input_number % 2 == 0    
      print "\n\n"
      print "The value #{input_number} is an even number."
      print "\n\n"
   else 
      print "\n\n"            
      print "The value #{input_number} is an odd number."
      print "\n\n"
   end
end

val_input =""
answer = ""

until answer.downcase == "n" do 
print "\n\n"
print "===== ODD AND EVEN NUMBER CHECKER IN RUBY ====="
print "\n\n"
print "Created by Mr. Jake R. Pomperada"
print "\n\n"
print "Give a number : "
val_input = gets.to_i

check_odd_even(val_input)

print "\n"
print "Do you want to continue Y/N ? : "
answer= gets.chop
end  
print "\n\n"
    print "End of Program"
    print "\n\n"







Celsius To Fahrenheit Converter in Ruby

Here is a sample program that will ask the user to give a value in temperature in Celsius and it will converted into Fahrenheit equivalent in Ruby. I created a method in this example to compute the Fahrenheit equivalent.

 I am currently accepting programming and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.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 is (034) 4335675.





Sample Program Output


Program Listing

temp.rb


# temp.rb
# Written By: Mr. Jake R. Pomperada, MAED-IT
# December 13, 2017
# Tool : Ruby and Sublime Text Editor
# Location : Bacolod City, Negros Occidental Philippines

# method to celsius to fahrenheit

def convert_temp(celsius)
  fahrenheit = (celsius.to_f * 9 / 5) + 32
  print "\n\n"
  print "The equivalent is: #{fahrenheit.round(2)} degrees fahrenheit."
  print "\n\n"
end

celsius_input =""
answer = ""

until answer.downcase == "n" do 
print "\n\n"
print "===== CELSIUS TO FAHRENHEIT CONVERTER IN RUBY ====="
print "\n\n"
print "Created by Mr. Jake R. Pomperada"
print "\n\n"
print "Give temperature in celsius : "
celsius_input = gets.to_i

convert_temp(celsius_input)

print "\n"
print "Do you want to continue Y/N ? : "
answer= gets.chop
end  
print "\n\n"
    print "End of Program"
    print "\n\n"




Word Counter in Ruby

In this article I would like to share with you a sample program that will ask the user to give a string or sentence and then our program will count the number of words in the given string or sentence using Ruby as our programming language. The  code is very short and easy to understand.

I am currently accepting programming and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.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 is (034) 4335675.




Sample Program Output


Program Listing

word.rb

# word.rb
# Written By: Mr. Jake R. Pomperada, MAED-IT
# December 13, 2017
# Tool : Ruby and Sublime Text Editor
# Location : Bacolod City, Negros Occidental Philippines

# method to count the word in the sentence

def wordcount(str_value)
    str_value.split(/\s+/).length
end

str_input =""
answer = ""

until answer.downcase == "n" do 
print "\n\n"
print "===== WORD COUNTER IN RUBY ====="
print "\n\n"
print "Created by Mr. Jake R. Pomperada"
print "\n\n"
print "Give a string : "
str_input = gets.chop

total_words = wordcount(str_input)

print "\n\n"
puts "The total number of words in the given the sentence is #{total_words}."
print "\n"
print "Do you want to continue Y/N ? : "
answer= gets.chop
end  
print "\n\n"
    print "End of Program"
    print "\n\n"


Friday, December 8, 2017

For Statement in Go

A very simple program that I wrote using Go programming language to demonstrate how for statement works.

I am currently accepting programming and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.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 is (034) 4335675.



Sample Program Output


Program Listing

for.go

// For Loop Statement in Go 
// Written By Mr. Jake R. Pomperada
// December 8, 2017

package main

import "fmt"

func main(){
    fmt.Print("\n\n")
fmt.Print("For Loop Statement in Go")
fmt.Print("\n\n")
    for a := 1; a <= 20; a++ {
        fmt.Print(" ",a , " ")
    }
fmt.Print("\n\n")
    fmt.Print("End of Program")
    fmt.Print("\n\n")
   
}

Tuesday, December 5, 2017

Navigational Menu in HTML and CSS

I just create a simple navigational menu using HTML and CSS I try to learn web page design and development which is not my strong skill set.  The code is very simple and easy to understand. I hope you will like my work.

I am currently accepting programming and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.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 is (034) 4335675.


Sample Program Output



Program Listing

index.htm

<!-- index.htm                                                          -->
<!-- Written By Mr. Jake R. Pomperada, MAED-IT  -->
<!-- December 5, 2017                                             -->
<html>
 <head>
  <title>
  Mini Tabs Using CSS
  </title>
  </head>
  <style>

  h1 {
  font-family: Arial, san-serif;
  font-size: 24px;
  color: #fff;
  padding: 4px;
  background-color:  #696;
  }

  #minitabs  {
     margin:0;
     padding: 0 0 20px 10px;
     border-bottom: 1px solid #696;
   }
  
  #minitabs li {
  font-family: Arial, san-serif;
  font-size: 20px;
  margin:0;
  padding: 0;
  display: inline;
  list-style-type: none;
  }
  
  #minitabs a {
  float: left;
  line-height: 14px;
  font-weight: bold;
  margin:0 12px 6px 12px;
  text-decoration: none;
  color: #9c9;
  }

 #minitabs a.active, #minitabs a:hover {
  border-bottom:  6px solid #969;
  padding-bottom:  2px;
  color : #363;
 }

 #minitabs a:hover {
  color:#696;
 }

</style>

<body>
<br><br>
<h1> Simple Navigation Menu Using HTML and CSS </h1> 
   <br><br>
<ul id="minitabs">
<li> <a href="/apples/" title="Click for Apples.">
Apples</a></li>
<li> <a href="/oranges/" title="Click for Oranges.">
Oranges</a></li>
<li> <a href="/banana/" title="Click for Banana.">
Banana</a></li>
<li> <a href="/grapes/" title="Click for Grapes.">
Grapes</a></li>
    </ul>

</body>
</html>
    


Friday, December 1, 2017

Positive and Negative Number Checker in Go

Here is a simple program that I wrote in Go to check if the given number by our user is positive or negative number.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.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 is (034) 4335675.




Sample Program Output


Program Listing

negative.go


// Positive and Negative Number Checker in Go 
// Written By Mr. Jake R. Pomperada
// December 1, 2017

package main

import "fmt"

func main(){
    var a int

fmt.Print("\n\n")
fmt.Print("Positive and Negative Number Checker in Go")
fmt.Print("\n\n")
    fmt.Print("Give a Number : ")
    fmt.Scanln(&a)
    fmt.Print("\n\n")
    if(a>=0){
        fmt.Println("The given number " ,a," is Positive number.")
    }else{
        fmt.Println("The given number " ,a, " is Negative number.")
    }
    fmt.Print("\n\n")
    fmt.Print("End of Program")
    fmt.Print("\n\n")
   
}






Odd and Even Number Checker in Go

A very simple program that I wrote using Golang that will ask the user to give a number and then our program will check and determine if the given number is an Odd or Even number.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.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 is (034) 4335675.





Sample Program Output


Program Listing


odd_even.go


// Odd and Even Number Checker in Go 
// Written By Mr. Jake R. Pomperada
// December 1, 2017

package main

import "fmt"

func main(){
    var a int

fmt.Print("\n\n")
fmt.Print("Odd and Even Number Checker in Go")
fmt.Print("\n\n")
    fmt.Print("Give a Number : ")
    fmt.Scanln(&a)
    fmt.Print("\n\n")
    if(a%2==0){
        fmt.Println("The given number " ,a," is Even number.")
    }else{
        fmt.Println("The given number " ,a, " is Odd number.")
    }
    fmt.Print("\n\n")
    fmt.Print("End of Program")
    fmt.Print("\n\n")
   
}







Area of the Circle Solver in Go

I am a beginner in terms of programming using Go programming language I wrote this program to ask the user to give a the radius of the circle and then it will computes it's area. The code is for beginners in Go programming.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.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 is (034) 4335675.





Sample Program Output


Program Listing

area.go


// Area of the Circle Solver in Go 
// Written By Mr. Jake R. Pomperada
// December 1, 2017

package main

import (
    "fmt"
)


func main(){
    var rad float64
    const PI float64 = 3.1415 // Constant Declaration
    var area float64
   
    fmt.Print("\n\n")
fmt.Print("Area of The Circle Solver")
fmt.Print("\n\n")
    fmt.Print("Enter Radius of The Circle  : ")
    fmt.Scanln(&rad)
    
    area = PI * rad * rad   

    fmt.Print("\n\n")
    fmt.Printf("The area of the circe is %.2f" ,area)
    fmt.Print("\n\n")
    fmt.Print("End of Program")
    fmt.Print("\n\n")
   
}