Monday, July 1, 2019

Money Bill Checker in Golang


Write and Design a program that will ask the user to give an amount and then the program will check and determine the money bill denomination based on the amount given by the user. The money bill denomination to be used in the program will be 500,100,50,20,10,5,2 and 1 bills.

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

/* bills.go
   Written By :
   Jake R. Pomperada
    April 3, 2019 Wednesday
   Bacolod City, Negros Occidental
*/
package main

import "fmt"

var amount int32

var note1000, note500, note100, note50 int32
var note20,note10 ,note5, note2, note1 int32

func main(){
fmt.Print("\n");
fmt.Print("\tMoney Bill Checker");
fmt.Print("\n\n");
fmt.Print("\tEnter amount: ")
    fmt.Scanln(&amount)
if (amount >= 1000) {
note1000 = amount/1000;
amount -= note1000 * 1000;
}
if (amount >= 500) {
note500 = amount/500;
amount -= note500 * 500;
}
if amount >= 100 {
note100 = amount/100;
amount -= note100 * 100;
   }
if(amount >= 50) {
note50 = amount/50;
amount -= note50 * 50;
}
if(amount >= 20){
note20 = amount/20;
amount -= note20 * 20;
}
if(amount >= 10) {
note10 = amount/10;
amount -= note10 * 10;
}
if(amount >= 5) {
note5 = amount/5;
amount -= note5 * 5;
}
if(amount >= 2) {
note2 = amount /2;
amount -= note2 * 2;
}
if (amount >= 1) {
note1 = amount;
}
fmt.Print("\n");
fmt.Print("\t===== DISPLAY RESULT =====\n\n");
fmt.Print("\t  Total number of notes  \n\n");
fmt.Print("\tPHP 1000 = ",note1000 ,"\n");
fmt.Print("\tPHP 500 =  ",note500,"\n");
fmt.Print("\tPHP 100 = ",note100,"\n");
fmt.Print("\tPHP 50 =  ",note50,"\n");
fmt.Print("\tPHP 20 =  ",note20,"\n");
fmt.Print("\tPHP 10 =  ",note10,"\n");
fmt.Print("\tPHP 5 =   ",note5,"\n");
fmt.Print("\tPHP 2 =   ",note2,"\n");
fmt.Print("\tPHP 1 =   ",note1,"\n");
fmt.Print("\n");
fmt.Print("\tEnd of Program");
fmt.Print("\n\n");
}


No comments:

Post a Comment