Friday, August 2, 2019

Square Tables Using Hashes in Ruby


Write a program uses hashes to display a series of values from 1 to 10 and its corresponding square values equivalent in Ruby 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.

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_hashes.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 17, 2019   Tuesday   12:30 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@gmail.com and jakerpomperada@yahoo.com

  print "\n"
  print "\t===== Square Tables Using Hashes ====="
  print "\n\n"

val_num  = {   
    1 => 1,2 =>2,3 =>3,4 =>4,
    5 => 5,6 =>6,7 =>7,8 =>8,
    9 => 9,10 =>10,11 => 11,12 => 12   
    }   
 print("\tValues\tSquare Values")
 print("\n\n")
val_num.each do |key, value|
  square = key * value
 print "\t#{key} \t    #{square}\n"
end
 print("\t")   
 print "\n";
 print "\tEnd of Program"








Two-Dimensional Array Example in Go

A simple program to show you how to use two-dimensional array in golang 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.

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 Output

/* two_dimensional_one.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 2, 2019  Friday   7:37 AM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */
package main

import "fmt"

func main() {
fmt.Print("\n")
fmt.Print("\tTwo-Dimensional Array Example in Go")
fmt.Print("\n\n")
/* Two dimensional array declare and initilize */
var array_one = [3][2]int{{0, 1}, {1, 2}, {2, 3}}
// shorthand two dimensional array variable declaration
array_two := [2][2]int{{0, 1}, {1, 2}}
var i, j int
/* Iterating elements array one using for loop statement */
for i = 0; i < 3; i++ {
for j = 0; j < 2; j++ {
fmt.Printf("\tarray_one[%d][%d] = %d\n", i, j, array_one[i][j])
}
}
/* Iterating elements array two using for loop statement */
for i = 0; i < 2; i++ {
for j = 0; j < 2; j++ {
fmt.Printf("\tarray_two[%d][%d] = %d\n", i, j, array_two[i][j])
}
}
fmt.Print("\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}


Average of Numbers Using Two-Dimensional Arrays in Golang

Write a program using a two-dimensional array to calculate the average  of n numbers using for loop 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


/* average.go
   Author   : Mr. Jake Rodriguez Pomperada,MAED-IT
   Date     : August 2, 2019    Friday  11:56 AM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */

package main

import "fmt"

func main() {
var m[100][1] int

n := 0
i := 0
average := 0
sum := 0

fmt.Print("\n")
fmt.Print("\tAverage of Numbers Using Two-Dimensional Arrays")
fmt.Print("\n\n")

fmt.Printf("\tHow many items? : ");
fmt.Scanln(&n);
fmt.Print("\n")
for i=1;i<=n;i++  {
fmt.Printf("\tEnter value in item no. %d : ",i);
fmt.Scanln(&m[i][0])
    sum+=m[i][0]
}
   average= (sum /n)
fmt.Print("\n")
fmt.Printf("\tThe average of n numbers is %d.",average);
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}









Swap Two Numbers Using Two-Dimensional Arrays in Golang

Write a program using two-dimensional arrays that will ask the user to give two numbers and then the program will swap the arrangement of the two numbers 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 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


/* swap.go
   Author   : Mr. Jake Rodriguez Pomperada,MAED-IT
   Date     : August 2, 2019    Friday   8:47 AM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */

package main
import "fmt"
func main() {
var val[2][2] int
temp := 0
fmt.Print("\n")
fmt.Print("\tSwap Two Numbers Using Two-Dimensional Arrays")
fmt.Print("\n\n")
fmt.Print("\tEnter any two numbers: ")
fmt.Scan(&val[0][0],&val[0][1])
fmt.Print("\n")
fmt.Println("\tOriginal Arrangement")
fmt.Print("\n")
fmt.Println("\t",val[0][0]," \t ",val[0][1])
temp = val[0][0]
val[0][0] = val[0][1]
val[0][1] = temp
fmt.Print("\n")
fmt.Println("\tSwap Arrangement")
fmt.Print("\n")
fmt.Println("\t",val[0][0]," \t ",val[0][1])
fmt.Print("\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}






Addition of Two Numbers Using Two-Dimensional Arrays in Golang

Write a program using a two-dimensional array that will ask the user to give two numbers and then the program will compute the sum of the two 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

/* add.go
   Author   : Mr. Jake Rodriguez Pomperada,MAED-IT
   Date     : August 2, 2019    Friday   8:14 AM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */

package main

import "fmt"

func main() {
var val[2][2] int32

var sum int32

fmt.Print("\n")
fmt.Print("\tAddition of Two Numbers Using Two-Dimensional Arrays")
fmt.Print("\n\n")
fmt.Print("\tEnter two numbers: ")
fmt.Scanf("%d%d",&val[0][0],&val[0][1])
sum = (val[0][0]+val[0][1])
fmt.Print("\n")
fmt.Println("\tThe sum of",val[0][0], "and",val[0][1] ,"is",sum,".")
fmt.Print("\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}




Another Example of One-Dimensional Array in Golang

Here is another example of how to use one-dimensional array in Golang 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.

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

/* example_no_2.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 1, 2019  Thursday  4:20 PM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */
package main

import "fmt"

func main() {

var j[6]int /* An array of 6 integers */

j[0] = 201
j[1] = 202
j[2] = 203
j[3] = 205
j[4] = 206
j[5] = 207

fmt.Printf("\n")
fmt.Print("\tAnother Example of One-Dimensional Array")
fmt.Print("\n\n")
fmt.Printf("\tj[0] = %d, j[1] = %d, j[2] = %d\n", j[0], j[1], j[2])
fmt.Printf("\n")
fmt.Printf("\tj[3] = %d, j[4] = %d, j[5] = %d\n", j[3], j[4], j[5])
fmt.Printf("\n")
fmt.Println("\tx =",j)
}




One Dimensional Array Demonstration in Go

Here is a sample program to show how to use One Dimensional Array Demonstration in Go.

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

/* example_no_1.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : July 31, 2019  Wednesday  9:22 PM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */

package main

import "fmt"

func main() {

score := [12] int {5,10,15,20,25,30,35,40,45,50,55,60};

    a := 0
fmt.Print("\n")
fmt.Printf("\tOne Dimensional Array Demonstration in Go");
fmt.Printf("\n\n");
for a=0; a<12; a++ {
   fmt.Printf("\t");
   fmt.Printf("score[%d]  = %d\n ",a+1,score[a]);
}
fmt.Print("\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}




Finding the Smallest Value in Array in Golang


Write a program using a one-dimensional array to find which of the given numbers 124, -45, 451,987, -1341,5,678,346,881 has the smallest in terms of numerical value 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

/* smallest.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 2, 2019  Friday   7:23 AM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */
package main

import "fmt"

func main() {

     array_values := []int{124, -45, 451,987, -1341,5,678,346,881}

fmt.Printf("\n")
fmt.Print("\tFinding the Smallest Value in Array")
fmt.Print("\n\n")

smallestNumber := array_values[0]
for _, element := range array_values {
if element < smallestNumber {
smallestNumber = element

}
}
fmt.Printf("\tThe Smallest Number in the Array is %d.  ", smallestNumber)
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}