Tuesday, August 6, 2019

Length of the String in Golang


Write a program that will count the length in the given string see the
output below.

Length of the String

Given String: Computer Programming in Go is Fun and Easy 

The length of the string is 42.

End of 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


/* string_length.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 4, 2019  Sunday  5: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("\tLength of the String")
fmt.Print("\n")

str := "Computer Programming in Go is Fun and Easy"

fmt.Print("\n")
fmt.Printf("\tGiven String : %s ",str)
fmt.Print("\n\n")
fmt.Printf("\tThe length of the string is %d.",len(str))
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}






Number of Words Count in a String in Golang

Write a program that will ask the user to give a string or a sentence and then the program will count the number of words in the given string or sentence.

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

/* word_count.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 4, 2019  Sunday  9:13 PM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */


package main

import (
"bufio"
"fmt"
"os"
"regexp"
"strings"
)

func WordCount(value string) int {
// Match non-space character sequences.
re := regexp.MustCompile(`[\S]+`)

// Find all matches and return count.
results := re.FindAllString(value, -1)
return len(results)
}

func main() {
consoleReader := bufio.NewReader(os.Stdin)
fmt.Print("\n")
fmt.Print("\tNumber of Words Count in a String")
fmt.Print("\n\n")
fmt.Print("\tGive a String : ")
str, _ := consoleReader.ReadString('\n')
fmt.Print("\n")

display := WordCount(strings.ToLower(str))

fmt.Print("\tDisplay the Results")
fmt.Print("\n\n")
fmt.Printf("\tThe number of words in the given string is %d.",display)
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}








Count Number of Vowels in a String in Golang

Write a program to ask the user to give a string and then the program will count the number of vowels in the given string 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

/* vowel_count.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 4, 2019  Sunday  9:12 PM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */


package main

import (
"bufio"
"fmt"
"os"
"regexp"
"strings"
)

func count_vowels_regex(s string) map[string]int {
m     := make(map[string]int)
re, _ := regexp.Compile(`[aeiou]`)
res   := re.FindAllString(s, -1)
for _, v := range res {
m[v]++
}
return m
}

func main() {
consoleReader := bufio.NewReader(os.Stdin)
fmt.Print("\n")
fmt.Print("\tCount Number of Vowels in a String")
fmt.Print("\n\n")
fmt.Print("\tGive a String : ")
str, _ := consoleReader.ReadString('\n')
fmt.Print("\n")

  display := count_vowels_regex(strings.ToLower(str))

fmt.Print("\tDisplay the Results")
fmt.Print("\n\n")
fmt.Print("\t",display)
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}









String Palindrome in Golang

Write a program that will ask the user to give a string and then the program will check if the given string a Palindrome or Not a Palindrome.


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

/* palindrome.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 4, 2019  Sunday  6:26 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"
"strings"
)

func isPalindrome(input string) bool {
// Change the input string to lower case.
input = strings.ToLower(input)

// loop through half of the array
for i := 0; i < len(input)/2; i++ {
if input[i] != input[len(input)-i-1] {
return false
}
}
return true
}

func main() {
var str string
fmt.Print("\n")
fmt.Print("\tString Palindrome")
fmt.Print("\n\n")
fmt.Print("\tGive a String : ")
fmt.Scanln(&str)
fmt.Print("\n")

display := strings.ToUpper(str)

if (isPalindrome(str)) {
fmt.Print("\tThe given string ",display, "is a Palindrome.")
} else {
fmt.Printf("\tThe given string ",display, "is Not a Palindrome.")
}
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}









Friday, August 2, 2019

Leap Year Checker Using Hashes in Ruby


Write a program using hashes to check and determine which of the following years 
1991,1992,1993,1994,1995,1996,1998,1999,2000,2001,2002,2003,2004,2008,2012,
2016,2020 and 2024 are leap years and not a leap years 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


Program Listing

# leap_year.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 18, 2019   Thursday  4:58 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"
  print "\t===== Leap Year Checker Using Hashes ====="
  print "\n\n"

year_list  = {   
    1 =>1991,2=>1992,3=>1993,4=>1994,
    5 => 1995,6 =>1996,7=>1998,8 =>1999,
    9 =>2000,10 =>2001,11=>2002,12 =>2003,
    13 => 2004,14 =>2008,15=>2012,16=>20016,
    17=>2020,18=>2024   
    }   
 print("\tList of Leap Years")
 print("\n\n")
 print("\t")
year_list.each do |key, value|
  if ((value % 4 == 0) && (value % 100 != 0) || (value % 400 == 0))
    print " #{value} " 
   end    
end
 print("\n\n")
 
 print("\tList of Not a Leap Years")
 print("\n\n")
 print("\t")
 year_list.each do |key, value|
   if ((value % 4 != 0)) 
     print " #{value} " 
    end    
 end
 print "\n\n";
 print "\tEnd of Program"


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"