Friday, August 2, 2019

Positive and Negative Numbers Using Hashes in Ruby

Write a program uses hashes that will check and list down the series of positive and negative numbers from 1 to 12 to the screen using Ruby programming languages.

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

# positive_negative.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 17, 2019   Tuesday   1:32 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===== Positive and Negative Numbers 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("\tList of Postive Numbers")
 print("\n\n")
 print("\t")
val_num.each do |key, value|
  if (value >=0)
    print " #{value} " 
   end    
end
 print("\n\n")

 print("\tList of Negative Numbers")
 print("\n\n")
print("\t")
 val_num.each do |key, value|
   if (value < 0)
     print " #{value} " 
    end    
 end

 print "\n\n";
 print "\tEnd of Program"




Even and Odd Number Listing Using Hashes in Ruby

Write a program uses hashes that will check and list down the series of even and odd numbers from 1 to 12 to the screen using 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

# even_odd.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 17, 2019   Tuesday   1:32 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===== Even and Odd Number Listing 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("\tList of Even Numbers")
 print("\n\n")
 print("\t")
val_num.each do |key, value|
  if (key % 2 == 0)
    print " #{key} " 
   end    
end
 print("\n\n")
 print("\tList of ODD Numbers")
 print("\n\n")
print("\t")
 val_num.each do |key, value|
   if (key % 2 != 0)
     print " #{key} " 
    end    
 end

 print "\n\n";
 print "\tEnd of Program"






Car Colors Display in Ruby

Write a program that uses hashes that will display only the colors of the brand of cars in an upper case format. The list of car brands in the following Ford - Red, Toyota - Blue, Suzuki - Yellow, BMW - Black and Chevy - Orange using 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

# car_colors.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 16, 2019   Tuesday   8:51 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@gmail.com and jakerpomperada@yahoo.com

  print "\n\n"
  print "\t===== Car Colors Display ====="
  print "\n\n"

cars  = {   
    "Ford" => "Red",   
    "Toyota" => "Blue",   
    "Suzuki" => "Yellow",   
    "BMW" => "Black",
    "Hyundai" => "Black",
    "Chevy" => "Orange"
    }   
 print("\tList Car Colors")
 print("\n\n")
 print("\t")
 puts cars['Ford'].upcase
 print("\t")   
 puts cars['Toyota'].upcase   
 print("\t")
 puts cars['Suzuki'].upcase   
 print("\t")
 puts cars['BMW'].upcase  
 print("\t")
 puts cars['Hyundai'].upcase
 print("\t")
 puts cars['Chevy'].upcase
 print "\n\n";
 print "\tEnd of Program"





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")
}