Friday, August 2, 2019

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




Bubble Sort Program in Go


Write a program using a one-dimensional array to implement a bubble sort algorithm. The program will ask the user how many items to be processed and then the program will display the original arrangement of the numbers and then display the sorted arrangement of the numbers 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

/* bubble_sort.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 1, 2019  Thursday  9:54 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 items[50] int
num_input := 0
a := 0
b := 0
temp := 0

fmt.Print("\n")
fmt.Print("\t\tBubble Sort Program in Go")
fmt.Print("\n\n")
fmt.Print("\tGive the size of array: ");
fmt.Scanln(&num_input)
fmt.Print("\n");
for a = 0; a < num_input; a++ {
fmt.Printf("\tEnter array element value in item no. %d : ",a+1);
fmt.Scanln(&items[a])
}
fmt.Print("\n");
fmt.Println("\tOriginal Array Arrangement");
fmt.Print("\n");
for a = 0; a < num_input; a++ {
fmt.Printf("\t%d ", items[a])
}
for a = 1; a < num_input; a++ {
for b = 0; b < (num_input - a); b++ {
if (items[b] > items[b+1]) {
temp = items[b]
items[b] = items[b+1]
items[b+1] = temp
}
}
}
fmt.Print("\n\n");
fmt.Println("\tSorted Array Arrangement");
fmt.Print("\n");
for a = 0; a < num_input; a++ {
fmt.Printf("\t%d ", items[a])
}
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}
}









Linear Search Program in Golang

Design a program using a one-dimensional array that demonstrates the concept of linear search. The program will ask the user how many elements to be processed and then the program will ask the user to give a series of numbers and the number to be searched. If the given number will be found from the list the program will display the number and then the exact location where the number is located. The program also will display no number found when the search number is not given from the list.

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

/* linear_search.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 1, 2019  Thursday  9:00 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 arr [10] int
b := 0
c := 0
pos := 0
num_input := 0

fmt.Print("\n")
fmt.Print("\t\tLinear Search Program in Golang")
fmt.Print("\n\n")
fmt.Printf("\tEnter the array size : ");
fmt.Scanln(&num_input);
fmt.Printf("\n");
for b = 0; b < num_input; b++ {
fmt.Printf("\tEnter Array Element Item No. %d : ",b+1);
fmt.Scanln(&arr[b]);
}
fmt.Printf("\n");
fmt.Printf("\tEnter the number to be search : ")
fmt.Scanln(&num_input)
for b = 0; b < num_input; b++ {
if (arr[b] == num_input) {
c = 1;
pos = b + 1;
break;
}
}

if (c == 0) {
fmt.Printf("\n");
fmt.Printf("\tSorry the number %d is not found from the list.", num_input);
} else {
fmt.Printf("\n");
fmt.Printf("\tThe number %d found at position %d.", num_input, pos);
}
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}
}


Average Grade Solver Using One-Dimensional Array in Golang


Write a program using a one-dimensional array to ask the user to give a series of grades and then the program will compute the average grade 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

/* average_grade.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 1, 2019  Thursday  8:31 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 grades[6] int
a :=0
solve := 0
sum := 0


fmt.Print("\n")
fmt.Print("\t\tAverage Grade Solver")
fmt.Print("\n\n")

for a = 1; a <= 5; a+=1 {
fmt.Printf("\tEnter Grade No. %d : ", a);
fmt.Scanln(&grades[a]);
}

for a=0; a<=5; a+=1 {
sum = sum + grades[a];
solve =(sum/5);
}

fmt.Printf("\n");
fmt.Printf("\tThe average grades is %d. ",solve);
fmt.Printf("\n\n");
if (solve >=75) {
fmt.Printf("\tYou Passed the subject.");
} else {
fmt.Printf("\tYou Failed the subject.");
}

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








Running Sum of Numbers in Golang

Write a program that uses a one-dimensional array that will ask the user how many items to be processed and then the program will ask the user to give a series of numbers. The program will compute the running sum or summation value of the given 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


/* summation.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 1, 2019  Thursday  8:31 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 val_num[100] int
var a int
var b int

b = 0
        sum := 0

fmt.Print("\n")
fmt.Print("\t\tRUNNING SUM OF NUMBERS")
fmt.Print("\n\n")
fmt.Print("\tHow many items be process? : ");
fmt.Scanln(&b);
for a = 1; a <= b; a+=1 {
fmt.Print("\n")
fmt.Printf("\tEnter year in item no. %d : ", a);
fmt.Scanln(&val_num[a]);
sum += val_num[a]
fmt.Print("\n")
fmt.Printf("\tThe Running Sum is %d.",sum)
}

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