Thursday, August 1, 2019

Find the Day of the Week Using Functions in Golang

Design a program that will ask the user to print the day name of the week using function using Golang.

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


/* days.go
Authors
Mr. Jake R. Pomperada
Mr. Rollyn M.  Moises
Mr. Sunday Vince V. Latergo
Date : July 25, 2019  Thursday  4:32 PM
 */
package main

import "fmt"

func days_week (day int) int {
if day == 1 {
fmt.Print("\n");
fmt.Print("\tThe given day is Monday.");
} else if day == 2 {
fmt.Print("\n");
fmt.Print("\tThe given day is Tuesday.");
} else if day == 3 {
fmt.Print("\n");
fmt.Print("\tThe given day is Wednesday.");
} else if day == 4 {
fmt.Print("\n");
fmt.Print("\tThe given day is Thursday.");
} else if day == 5 {
fmt.Print("\n");
fmt.Print("\tThe given day is Friday.");
} else if day == 6 {
fmt.Print("\n");
fmt.Print("\tThe given day is Saturday.");
} else if day == 7 {
fmt.Print("\n");
fmt.Print("\tThe given day is Sunday.");
} else {
fmt.Print("\n");
fmt.Print("\tInvalid Input! Please enter day in between 1-7.");
}
  return 0
}

func main() {
var day int
fmt.Print("\n")
fmt.Print("\tFind the Day of the Week Using Functions")
fmt.Print("\n\n")
fmt.Print("\tEnter Day Number (1-7) : ")
fmt.Scan(&day)

days_week(day)

fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}





Decimal To Roman Numeral Converter Using Functions in Golang


Write a program that will ask the user to give a  decimal number and then the program will convert the given number into the roman numeral equivalent value.

Decimal    Roman
1              I
4             IV
5             V
9             IX
10                X
40             XL
50                L
90            XC
100            C
400            CD
500             D
900            CM
1000    M

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

/* roman_numeral.go
Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
Date     : July 31, 2019  Wednesday 1:28 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 DecimalToRoman(num int) string {
values := []int{
1000, 900, 500, 400,
100, 90, 50, 40,
10, 9, 5, 4, 1,
}

symbols := []string{
"M", "CM", "D", "CD",
"C", "XC", "L", "XL",
"X", "IX", "V", "IV",
"I"}
roman := ""
i := 0
for num > 0 {
k := num / values[i]
for j := 0; j < k; j++ {
roman += symbols[i]
num -= values[i]
}
i++
}
return roman
}

func main() {

var val_num int

fmt.Print("\n")
fmt.Print("\tDecimal To Roman Numeral Converter Using Functions")
fmt.Print("\n\n")
fmt.Print("\tGive a Number     : ")
fmt.Scanf("%d",&val_num)

result := DecimalToRoman(val_num)

fmt.Print("\n")
fmt.Printf("\tThe roman numeral value of %d is %s.",val_num,result)
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}








Power of a Number Using Functions in Golang

Write a program that will ask the user to give base and exponent values and then the program will compute its power of the number value.

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

/* power_number.go
Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
Date     : July 31, 2019  Wednesday 1:08 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 RecursivePower(base int, exponent int) int {
if exponent != 0 {
return (base * RecursivePower(base, exponent-1))
} else {
return 1
}
}

func main() {

var exponent, base int

fmt.Print("\n")
fmt.Print("\tPower of a Number Using Functions")
fmt.Print("\n\n")
fmt.Print("\tGive a Base Value     : ")
fmt.Scanf("%d",&base)
fmt.Print("\tGive a Exponent Value : ")
fmt.Scanf("%d",&exponent)

result := RecursivePower(base,exponent)

fmt.Print("\n")
fmt.Printf("\tThe result of power calculation is %d",result)
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}







Legal Age Checker Using Function Statement in Golang


Write a program that will ask the user to give its age and then the program will check and determine if the given age of the user is already an adult or still a minor using functions.

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

/* legal_age.go
Authors
Mr. Jake R. Pomperada
Mr. Rollyn M.  Moises
Mr. Sunday V. Latergo
Date : July 31, 2019  Wednesday 12:47 PM
 */

package main

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

func check_age(age int32, name_display string) int {
switch {
case age >= 18:
fmt.Print("\tHello ", name_display)
fmt.Println("\tAt the age of", age, " years old you are already an Adult.")
default:
fmt.Print("\tHello ", name_display)
fmt.Println("\tAt the age of", age, "you are still a  Minor.")
}

return 0
}


func main() {

consoleReader := bufio.NewReader(os.Stdin)
var age int32

fmt.Print("\n")
fmt.Print("\tLegal Age Checker Using Function Statement")
fmt.Print("\n\n")
fmt.Print("\tWhat is your name?  : ")
user_name, _ := consoleReader.ReadString('\n')
fmt.Print("\tWhat is your age?   : ")
fmt.Scanf("%d",&age);
fmt.Print("\n")
name_display := strings.ToUpper(user_name)
check_age(age,name_display)
}








Even and Odd Numbers Checker Using Functions in Go

Write a program that will ask the user to give a number and then the program will check if the given number is an odd or even number using functions.

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.go
Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
Date     : July 31, 2019  Wednesday 12:08 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 even_odd_check(num_val int) int {

fmt.Print("\n")
if (num_val%2 == 0) {
fmt.Println("\tYour given number", num_val, "is an EVEN number.")
}

if (num_val%2 != 0) {
fmt.Println("\tYour given number", num_val, "is an ODD number.")
}
   return num_val
}

func main() {

var val1 int

fmt.Print("\n")
fmt.Print("\tEven and Odd Numbers Checker Using Functions")
fmt.Print("\n\n")
fmt.Print("\tGive a Number : ")
fmt.Scanf("%d",&val1)

even_odd_check(val1)

fmt.Print("\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}








Fibonacci Sequence Using Functions in Go

Write a program that will ask the user to give a number and then the program will generate a corresponding Fibonacci series of numbers. 

The Fibonacci sequence is a series where the next term is the sum of the previous two terms. 

The first two terms of the Fibonacci sequence is 0 followed by 1.

The Fibonacci sequence example.

1 0, 1, 1, 2, 3, 5, 8, 13, 21

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

/* fibonacci.go
Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
Date     : July 31, 2019  Wednesday 9:00 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"
"strconv"
)


func FibonacciRecursion(n int) int {
if n <= 1 {
return n
}
return FibonacciRecursion(n-1) + FibonacciRecursion(n-2)
}

func main() {

var val1 int

fmt.Print("\n")
fmt.Print("\tFibonacci Sequence Using Functions")
fmt.Print("\n\n")
fmt.Print("\tGive a Number : ")
fmt.Scanf("%d",&val1)

fmt.Print("\n")
fmt.Print("\tThe Fibonacci Sequence Series")
fmt.Print("\n\n")
fmt.Print("\t")
for i := 0; i < val1; i++ {
fmt.Print(strconv.Itoa(FibonacciRecursion(i)) + " ")
}
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}







Factorial Number Solver Using Functions in Golang

Write a program that uses a function that will ask the user to give a number and then the program will compute the factorial equivalent of the given number by the user.

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

/* factorial.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : July 31, 2019  Wednesday  5:52 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 factorial(a int) int {
fact := 1
for (a>=1){
fact=fact*a;
a--;
    }
return fact;
}


func main() {

var val1, results int

fmt.Print("\n")
fmt.Print("\tFactorial Number Solver Using Functions")
fmt.Print("\n\n")
fmt.Print("\tGive a Number : ")
fmt.Scanf("%d",&val1)

results = factorial(val1)

fmt.Print("\n")
fmt.Print("\tThe factorial value of ",val1," is ",results)
fmt.Print(".")
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}