Saturday, June 29, 2019

Why Use C Programming Language?

I have been using C programming language since 1996 during my sophomore years taking Bachelor of Science in Computer Science at the University of Negros Occidental-Recoletos here in my home town in Bacolod City, Negros Occidental Philippines. During that time Microsoft DOS is the most popular operating system and we are also using Microsoft Windows 95. 

The first C compiler that I am using in Turbo C 2.0 published by Borland International. I find learning C kinda difficult at first because I don't have a computer at home during those days I just rent or borrow computers from my classmates during my college day.  Below are the reasons why I think C is an important language in learning computer programming.


Why Use C?

At the present time, there are thousands of programming languages to choose from. But still, C programming language is being taught and use in everyday programming projects especially for those project which deals more on hardware interfacing and critical applications.  

There are some people says that C is already been surpass by C++, C#, and Java in terms of its popularity and uses in the modern programming project. In our own understanding here have listed the reasons why it is still beneficial to learn C at the present time.

We believe nobody can learn programming languages like C++, C# or Java effectively. Primarily because this programming language deals with advanced topics like classes, objects, inheritance, polymorphism, templates, exception handling, references, collections etc.do deal with apart from knowing the actual language elements. Learning these complicated concepts when you are not even comfortable with the basic language elements like variable declarations, control structures, conditional statements, identifiers.  Hence one should first learn all the language elements very thoroughly using C language before migrating to C++, C# or Java. Though these two-step learning process may take more time, at the end of it you will definitely find it worth the trouble.

Learning C language is very essential to understand the fundamentals of problem-solving and application of basic data structures like arrays, list, binary trees, sorting algorithms, etc. which can be applied also in C++, C#, and Java programming languages.

The use of microcontrollers like Arduino it uses a derivative version of C language in order to write computer programs into it.
Majority of operating systems like UNIX, Mac OS, Linux, and Microsoft Windows is still written in C. The device drivers used in Microsoft Windows is being written in C and some of them are also written in C++.

Web programming languages like PHP and Perl has based its program statement structures like looping statements and functions for example in C programming language. Understanding the C language, it is easier to learn PHP and Perl because you are already familiar with its programming statements.

The development of mobile phones, tablets, and printers their operating system and microcontroller programs most of the time is written in C. These programs not only have to run fast but also have to work in a limited amount of memory in its devices. No wonder that such programs are written in C. With these constraints on time and space, C is the ideal language of choice while building such operating systems and programs. A good example is the Android mobile phone operating system which is a very popular operating the system in a mobile phone, especially Smart Phones it is based on a modified version of Linux operating system developed by Google it is written in C.   The iOS operating system by Apple iPhones is also developed using C, C++, Objective-C and Swift programming languages.



Friday, June 28, 2019

Simple Payroll Program Using Methods in Ruby

A simple payroll program that I wrote using Ruby programming language using methods.

If you like my work please click the ads on my website to support my work. I will really appreciate your help. 

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

# payroll.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 18, 2019  Tuesday  3:48 PM
# Address  : Bacolod City, Negros Occidental
# Tools    : Eclipse IDE and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com

def display_result()
  puts "\n\n"
  print "\tSimple Payroll Program Using Methods";
  puts "\n\n"
  print "\tHow Many Days Work?   ";
  days = gets;
  days = days.to_i;
  print "\tSalary Per Day     : PHP ";
  rate = gets;
  rate = rate.to_f;
  
  # Solving Gross Salary Here 
  solve_gross = (days * rate);
  
  print "\n\n";
  puts "\tThe Gross Salary is PHP  %0.2f." % [solve_gross];
  print "\n\n";
  print "\tSSS Contribution        : PHP ";
  sss = gets;
  sss = sss.to_f;
  print "\tPAG-IBIG Contribution   : PHP  ";
  pag_ibig = gets;
  pag_ibig = pag_ibig.to_f;
  print "\tBIR Contribution        : PHP  ";
  bir = gets;
  bir = bir.to_f;
  print "\tPHILHEALTH Contribution : PHP   ";
  philhealth = gets;
  philhealth = philhealth.to_f;

  # Solving Total Deductions and Net Salary Here 
  total_deductions = (sss+pag_ibig+bir+philhealth);
  solve_net_salary = (solve_gross - total_deductions);

  print "\n\n";
  print "\t===== DISPLAY RESULT ====="
  print "\n\n";
  puts "\tGross Salary     : PHP %0.2f " % [solve_gross];
  print "\n";
  puts "\tTotal Deductions : PHP %0.2f " % [total_deductions];
  print "\n\n";
  puts "\tNet Salary       : PHP %0.2f " % [solve_net_salary];
  print "\n\n";
  print "\tEND OF PROGRAM";
  print "\n\n";
end

# Execution of our method display_result()   

display_result();


   




Kilograms To Pounds Converter in Ruby

A very simple program to convert kilograms to pounds using Ruby programming language. 

If you like my work please click the ads on my website to support my work. I will really appreciate your help. 

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

# kg_pounds.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 18, 2019   Tuesday  2:59 PM  
# Address  : Bacolod City, Negros Occidental
# Tools    : Sublime Text and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com

def kilograms_pounds(kg)
  pounds = kg * 2.20462262;
  return(pounds.round(2));
end

print "\n\n";
print "\tKilograms To Pounds Converter";
print "\n\n";
print "\tWhat is the Kilogram value? ";

kg_val = gets.to_i;

convert = kilograms_pounds(kg_val);

print "\n";
print "\tDISPLAY RESULTS"
print "\n\n";
print("\tThe #{kg_val} Kilogram(s) = #{convert} Pound(s).");
print "\n\n";
print "\tEnd of Program";
print "\n";


Linear Search in Ruby Using Arrays in Ruby

A very simple program that will show you how to perform a linear search using one-dimensional arrays using Ruby.

If you like my work please click the ads on my website to support my work. I will really appreciate your help. 

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.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 24, 2019   Monday 2:21 PM
# Address  : Bacolod City, Negros Occidental
# Tools    : Eclipse IDE and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com


puts "\n\n"
print "\tLinear Search in Ruby Using Arrays";
puts "\n\n"

print "\tEnter number of elements :  ";
num_val = gets.chomp
num_val = num_val.to_i;

nums = []

print("\n")   
for number in (1..num_val)
  print "\tValue in Item No. #{number} : ";
  nums[number] = gets.chomp
  nums[number] = nums[number].to_i;
  
 end

print "\n";
print "\tEnter number to search :  ";
search = gets.chomp
search = search.to_i;

print("\t");
print("\n\n");
for list_down in 1..num_val
  if (nums[list_down] == search)
       print("\t#{search} is present at location #{list_down} in the array.");
  end    
 end

if (nums[list_down] == num_val)
       print("\t#{search} isn't present in the array.");
  end   
print "\n\n";
print "\tEND OF PROGRAM";
print "\n\n";


Thursday, June 27, 2019

Do While and Break Program in Ruby

Here is a sample program to show you how to use do while and break program in Ruby programming language. I am using Eclipse PHP IDE as my editor in writing this Ruby script.

If you like my work please click the ads on my website to support my work. I will really appreciate your help. 

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


Program Listing


# do_break.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 13, 2019   Thursday  2:12 PM
# Address  : Bacolod City, Negros Occidental
# Tools    : Eclipse IDE and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com
puts "\n\n"
print "\tDo While and Break Program";
puts "\n\n"

loop do
  
  print("\tGive a number : ");   
  num_val = gets.chomp   
  num_val = num_val.to_i;
  
  print("\n");
  print("\tThe given number is #{num_val}.");
  if (num_val == 8)  
    break  
     print("\tQuit Program.");
   end
   print("\n\n");
end

print "\n\n";
print "\tEND OF PROGRAM";
print "\n\n";

Introduction To C Programming Book Launch


This will be my seventh book being published exclusively by https://www.mindshaperspublishing.com  In this book we discuss the fundamental concepts, commands, and applications of C language together with my co-author Dr. Kristine T. Soberano.

First of all, I would like to thank Negros Daily Bulletin especially to Sir Arman Toga and Sir James Sy Jr. for featuring us in your newspaper. In the publication of our book entitled "Introduction To C Programming" together with my co-author Dr. Kristine T. Soberano. For book orders, you may visit our publisher's website at https://www.mindshaperspublishing.com or send an email at mindshapersco@yahoo.com Thank you very much.


Array Basic Input and Output in Ruby

In this article, I would like to share with you a simple program that I wrote using Ruby programming language that will ask the user a series of an integer number and display the given integer number by the user in the screen using one-dimensional arrays. I am using Eclipse PHP IDE as my editor in writing this Ruby script.

If you like my work please click the ads on my website to support my work. I will really appreciate your help. 

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

# array1.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 24, 2019   Monday 2:21 PM
# Address  : Bacolod City, Negros Occidental
# Tools    : Eclipse IDE and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com


puts "\n\n"
print "\tArray Basic Input and Output in Ruby";
puts "\n\n"

print "\tHow many items?  ";
num_val = gets.chomp
num_val = num_val.to_i;

nums = []

print("\n")   
for number in (1..num_val)
  print "\tValue in Item No. #{number} : ";
  nums[number] = gets.chomp
  nums[number] = nums[number].to_i;
  
 end

print "\n";
print "\t===== List of Given Values ====="
print "\n\n";
print("\t");

for list_down in 1..num_val
   print(" " ,nums[list_down],"");
 end

print "\n\n";
print "\tEND OF PROGRAM";
print "\n\n";




Wednesday, June 26, 2019

Opening a Text File Using C++

A very simple code to open a text file using C++ as my programming language.

I am using Dev C++ as my C compiler in writing this program.

If you like my work please click the ads on my website to support my work. I will really appreciate your help. 

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




Program Listing

#include <iostream>
#include <fstream>

using namespace std;

int main(){
  fstream file;
  file.open ("example.txt", ios::out | ios::in );
  return 0;
}



Write a Text File in C

A simple program that I wrote using C programming to write a text file. 

I am using Dev C++ as my C compiler in writing this program.

If you like my work please click the ads on my website to support my work. I will really appreciate your help. 

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

/*open_write_read.c
 Author   : Mr. Jake R. Pomperada, MAED-IT
 Tool     : Dev C++ Version 5.11
 Date     : December 2, 2018  Sunday 6:30 AM 
*/

/* Open, write and close a file : */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main()
{
  FILE *fp ;
  char data[100];
    
  printf("\n\n");
  printf("\tText File Opening, Write and Read Example in C");
  printf("\n\n");
    // opening an existing file
    printf( "\tOpening the file write.txt in write mode" ) ;
    printf("\n\n");
    fp = fopen("write.txt", "w") ;
    if ( fp == NULL )
    {
        printf( "Could not open file write.txt" ) ;
        return 1;
    }
    printf("\tEnter some text from keyboard to write in the file write.txt" );  
printf("\n\n"); 
  /* getting input from user */
    while ( strlen ( gets( data ) ) > 0 )
    {
        /* writing in the file */
        fputs(data, fp) ;   
        fputs("\n", fp) ;
    }
    /* closing the file */
  printf("\n");  
  printf("\tClosing the file write.txt") ;
  fclose(fp);
  printf("\n");
  printf("\tData have been written successfully.");
  printf("\n\n");
  printf("\tEND OF PROGRAM");
  printf("\n\n");
  system("pause");

}