Thursday, August 1, 2019

Decimal To Word Converter Using Functions in Go

Write a program that will ask the user to give a number and then the program will convert the given number into word equivalent.

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

/* english.go
Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
Date     : July 31, 2019  Wednesday 3:11 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"
"math"
)

func pow(i int, p int) int {
return int(math.Pow(1000, float64(p)))
}

func spell(n int) string {
to19 := []string{"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve",
",Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"}

tens := []string{"Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"}
if n == 0 {
return ""
}
if n < 20 {
return to19[n-1]
}
if n < 100 {
return tens[n/10-2] + " " + spell(n%10)
}
if n < 1000 {
return to19[n/100-1] + " Hundred " + spell(n%100)
}

for idx, w := range []string{"Thousand", "Million", "Billion"} {
p := idx + 1
if n < pow(1000, (p+1)) {
return spell(n/pow(1000, p)) + " " + w + " " + spell(n%pow(1000, p))
}
}

return "error"
}

func main() {

var val_num int

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

result := spell(val_num)

fmt.Print("\n")
fmt.Printf("\tThe given number is %d.",val_num)
fmt.Print("\n\n")
fmt.Print("\t===== TRANSLATION RESULT =====")
fmt.Print("\n\n")
fmt.Printf("\t%s",result)
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}









Biggest Number Using Functions in Go

Write a program that will ask the user four numbers and then the program will check and determine which of the given number has the biggest value and display the results on the screen. The program also asks the user if the user would like to repeat running the program or not 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

/* four.go
Authors
Mr. Jake R. Pomperada
Mr. Rollyn M.  Moises
Mr. Sunday Vince V. Latergo
Date : July 31, 2019  Wednesday  2:53 AM
 */
package main

import (
"fmt"
"strings"
)


func Ask4confirm() bool {
var s string

fmt.Printf("\tDo you want to continue? (Y/N): ")
_, err := fmt.Scan(&s)
if err != nil {
panic(err)
}

s = strings.TrimSpace(s)
s = strings.ToLower(s)

if s == "y"  {
start()

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

}
return false

}


func start() {

var a, b, c,d int

fmt.Print("\n")
fmt.Print("\tBiggest Number Using Functions")
fmt.Print("\n\n")
fmt.Print("\tGive any four numbers : ")
fmt.Scan(&a, &b, &c, &d)

check_four(a,b,c,d)

isConfirmed := Ask4confirm()
if isConfirmed {
start()
}
}

func check_four(a,b,c,d int) int {
var biggest int
if a > b && a > c && a > d {
biggest = a
} else if b > c && b >d {
biggest = b
} else if c > d {
biggest = c
} else {
biggest = d
}
fmt.Print("\n")
fmt.Print("\tThe Biggest in Four Number is ", biggest)
fmt.Print("\n\n")

return 0
}


func main() {
start()
}




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