Wednesday, April 26, 2017

Area of the Circle in Visual Foxpro

Here is a sample program that will ask the user to give a value in radius and then the program will compute for the area of the circle. I wrote this sample program using Microsoft Visual Foxpro 5.0. I hope you will find my work useful. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Sample Program Output


Program Listing

Ok Button   Command1  Click

set decimal to 2
SET FIXED ON

clear

radius = val(thisform.text1.value) 
area = (3.1416 * radius * radius);

final_solve= round(area,2)

thisform.label4.caption = "The area of the circle is " + alltrim(thisform.text3.value)


thisform.text3.value =  final_solve


Clear Button  Command2  Click

thisform.text1.value=""
thisform.text3.value=""
thisform.text1.setfocus
thisform.label4.caption =""


Quit Button Command2  Click

Quit


Sunday, April 23, 2017

Payroll Program in Visual Foxpro

A very simple payroll program that I wrote using Microsoft Visual Foxpro to accept the employees number of days worked and the rate per day and then our program will compute its salary. The code is very basic and easy to understand I am using Microsoft Visual Foxpro 5.0 in writing this program. Thank you.


My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.







Sample Program Output


Program Listing


Ok Button   Command1  Click

set decimal to 2
SET FIXED ON

clear
days_worked = val(thisform.text1.value) 

rate_per_day = val(thisform.text2.value) 

solve_salary = (days_worked) * (rate_per_day)

final_solve= round(solve_salary,2)
thisform.label4.caption = "Your salary is Php " + alltrim(thisform.text3.value)


thisform.text3.value =  final_solve


Clear Button  Command2  Click

thisform.text1.value=""
thisform.text2.value=""
thisform.text3.value=""
thisform.text1.setfocus
thisform.label4.caption =""


Quit Button Command2  Click

Quit


Product of Two Numbers in Visual Foxpro

A very simple program that I wrote using Microsoft Visual Foxpro to ask the user to give two numbers and then our program will compute the product of two numbers given by the user. I wrote this code using Microsoft Visual Foxpro 5.0. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Sample Program Output



Program Listing

Ok Button   Command1  Click

number_val_1 = val(thisform.text1.value) 

number_val_2 = val(thisform.text2.value) 

solve_product = (number_val_1) * (number_val_2)

thisform.label4.caption = "The product of " + alltrim(str(number_val_1)) + " and " + alltrim(str(number_val_2)) + " is " + alltrim(str(solve_product)) + "."


Clear Button  Command2  Click

thisform.text1.value=""
thisform.text2.value=""
thisform.text1.setfocus
thisform.label4.caption =""


Quit Button Command2  Click

Quit


Positive and Negative Number Checker in Visual Foxpro

Here is a very simple program that I wrote using Microsoft Visual Foxpro to ask the user to give a number and then our program will check and determine if the given number is a POSITIVE or NEGATIVE number based on the given number by our user. The version of Visual Foxpro that I am using in this sample program is 5.0. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.







Sample Program Output


Program Listing

Ok Button   Command1  Click

number_val = val(thisform.text1.value) 

if (number_val >= 0) then
   MESSAGEBOX("The given number is a POSITIVE number.",0,"The Result")
   thisform.text1.value=""
   thisform.text1.setfocus
  else
   MESSAGEBOX("The given number is an NEGATIVE number.",0,"The Result")
   thisform.text1.value=""
   thisform.text1.setfocus
endif   


Clear Button  Command2  Click

thisform.text1.value=""
thisform.text1.setfocus


Quit Button Command2  Click

Quit




Odd and Even Number Checker in Visual Foxpro

Here is a very simple program that I wrote using Microsoft Visual Foxpro to ask the user to give a number and then our program will check and determine if the given number is an ODD or EVEN number based on the given number by our user. The version of Visual Foxpro that I am using in this sample program is 5.0. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.


 




Sample Program Output


Program Listing

Ok Button   Command1  Click

Remainder = val(thisform.text1.value) % 2

if (Remainder = 0) then
   MESSAGEBOX("The given number is an EVEN number.",0,"The Result")
   thisform.text1.value=""
   thisform.text1.setfocus
  else
   MESSAGEBOX("The given number is an ODD number.",0,"The Result")
   thisform.text1.value=""
   thisform.text1.setfocus
endif   


Clear Button  Command2  Click

thisform.text1.value=""
thisform.text1.setfocus


Quit Button Command2  Click

Quit




Addition of Three Numbers in Visual Foxpro

In this article I would like to share with you a sample program that add the sum of three numbers being given by our user using Microsoft Visual Foxpro as our programming language. The code is very short and easy to understand. I am using Visual Foxpro 5.0 in this sample program. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Sample Program Output


Program Listing

Ok Button   Command1  Click

thisform.text4.value= round(val(thisform.text1.value)+val(thisform.text2.value)+val(thisform.text3.value),0)


Clear Button  Command2  Click

thisform.text1.value=""
thisform.text2.value=""
thisform.text3.value=""
thisform.text4.value=""
thisform.text1.setfocus


Quit Button Command2  Click

Quit




Saturday, April 22, 2017

Payroll Program in Turbo Pascal

Here is a sample program that I wrote using Turbo Pascal 6 to ask the user how many days work and the rate per day and our program will compute for the salary of the employee. The code is very simple and easy to understand.  Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Sample Program Output


Program Listing


Program Payroll;

Uses Crt;

Var Daily_Rate, No_days_work, salary : Integer;

Begin

  Clrscr;
  Writeln;
  textcolor(white);
  Write('Payroll Program in Turbo Pascal');
  Writeln;
  Writeln;
  Write('How many days worked : ');
  Readln(No_days_work);
  Writeln;
  Write('What is the daily rate : ');
  Readln(Daily_Rate);

  Salary := (No_days_work * Daily_Rate);

  Writeln;
  Write('Your salary is  Php ',salary,'.');
  writeln;
  writeln;
  Write('End of Program');
  Readln;
 End.



Thursday, April 20, 2017

Maximum Number in Turbo Pascal

In this article I would like to share with you a sample program that will ask the user to give two numbers and then our program using functions in Pascal will check and determine which of the two number is the biggest in terms of numerical value. I wrote this code using Turbo Pascal 6.0 for DOS. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Sample Program Output


Program Listing


Program maximum_two_numbers;

Uses Crt;

Var val_1,val_2, return_value : Integer;


function maximum_checking(a, b: integer): integer;
var
   
   result: integer;

begin
   if ( a> b) then
      result := a
   
   else
      result := b;
     maximum_checking := result;
end;


Begin
  Clrscr;
  val_1 := 0; val_2 := 0;
  writeln;
  Writeln;
  Write('Maximum Number in Turbo Pascal');
  writeln;
  Writeln;
  Write('Enter First Value : ');
  Readln(val_1);
  Write('Enter Second Value : ');
  Readln(val_2);

  return_value := maximum_checking(val_1,val_2);

  writeln;
  writeln('The maximum value between ' ,val_1, ' and ', val_2, ' is ' ,return_value,'.');
  writeln;
  Writeln;
  Write('End of Program');
  Writeln;
  Readln;
End.




Tuesday, April 18, 2017

Positive and Negative Numbers in Turbo Pascal

Here is a sample program that will ask the user to give a number and then our program will determine and check if the given number is a positive or a negative number using Turbo Pascal the code is very short and easy to understand. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Sample Program Output


Program Listing

Program negative_positive_number;

Uses Crt;

Var Num : Integer;

Begin
  Clrscr;
  Num := 0;
  writeln;
  Writeln;
  Write('Negative and Positive Number in Turbo Pascal');
  writeln;
  Writeln;
  Write('Enter a Number : ');
  Readln(Num);

  if (num>=0) then 
  Begin
      Writeln;
      Write('Your given number ' ,num, ' is a POSITIVE NUMBER.');
      Writeln;
  End
     Else 
     Begin
      Writeln;
      Write('Your given number ' ,num, ' is a NEGATIVE NUMBER.');
      Writeln;
  End;

  Writeln;
  Write('End of Program');
  Writeln;
  Readln;

end.

Sum of Digits in Turbo Pascal

Here is a sample program that will ask the user to give a series of numbers and then it will count the total sum of the number given by our user. For example the user gives 123 our program will count the total sum of 6. I wrote the code using Turbo Pascal 7 for DOS running in DOSBOX emulator because I am using 64 Bit operating system Windows 7. I hope you will find my work useful. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Sample Program Output


Program Listing

Program sum_of_digits_pascal;

Uses Crt;

function SumOfDigitBase(n:longint;base:longint): longint;
var
  tmp: longint;
  digit,sum : longint;
Begin
  digit := 0;
  sum   := 0;
  While n > 0 do
  Begin
    tmp := n div base;
    digit := n-base*tmp;
    n := tmp;
    inc(sum,digit);
  end;
  SumOfDigitBase := sum;  
end;

Var Num,Process : Integer;
Begin
  Clrscr;
  Num := 0;
  Process := 0;
  writeln;
  Writeln;
  Write('Sum of Digits in Turbo Pascal');
  writeln;
  Writeln;
  Write('Enter a Number : ');
  Readln(Num);

  Process := SumOfDigitBase(Num,10);
  
  writeln;
  writeln('The total number of digits is  ',process,'.'); 
  Writeln;
  Write('End of Program');
  Writeln;
  Readln;

end.


Friday, April 14, 2017

Cube Root a Number in Visual Basic NET

In this article I would like to share with you guys a simple program that will ask the user to give a number and then our program will convert the given number into its cube root a number equivalent. I wrote this code using Microsoft Visual Basic NET 2013. I added an error checking for empty text box value.  I hope you will find my work useful thank you very much.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Sample Program Output


Program Listing

Public Class Form1
    Function CubeRoot(ByVal y As Integer) As Integer
        Return y ^ 3
    End Function

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        End
    End Sub


    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim a, solve As Integer
        Dim b As String

        a = Val(TextBox1.Text)

        solve = CubeRoot(a)

        If TextBox1.Text = "" Then
            MessageBox.Show("Sorry can't be empty.")
            TextBox1.Focus()

        Else
            Label2.Text = "The cube root value of " & a & " is " & solve & "."
        End If
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        Label2.Text = ""
        TextBox1.Focus()
    End Sub
End Class