Wednesday, June 26, 2019

Reading a Text File in C Language

In this article, I would like to show you how to read a text file using C 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



Sample Program Output


Content of the write.txt


Program Listing

/*read_file.c
 Author    : Mr. Jake Rodriguez Pomperada,BSCS,MAED-IT
 Date      : December 2, 2018  Sunday 11:26 AM
 Location  : Bacolod City, Negros Occidental
 Website   : http://www.jakerpomperada.com
 Emails    : jakerpomperada@jakerpomperada.com
             jakerpomperada@gmail.com
             jakerpomperada@yahoo.com
             jakerpomperada@aol.com
*/
#include <stdio.h>
#include <stdlib.h> /* For exit() function */
#include <stdlib.h> /* For system("pause"); statement */
int main()
{
    char c[1000];
    FILE *fptr;
    if ((fptr = fopen("write.txt", "r")) == NULL)
    {
        printf("Error! opening file");
        /* Program exits if file pointer returns NULL. */
        exit(1);         
    }
    /* reads text until newline */
    fscanf(fptr,"%[^\n]", c);
    printf("\n");
    printf("\tReading Data from the file:\n\n%s", c);
    fclose(fptr);
    printf("\n\n");
  printf("\tEND OF PROGRAM");
  printf("\n\n");
  system("pause");
}













Escape Sequences in C Language

In this article, I would like to share with you a sample program that I wrote using C programming language how to use escape sequence in a C 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

/* escape_sequence.c
   Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
   Date     : November 19, 2018   6:59 AM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@jakerpomperada.com
              jakerpomperada@gmail.com
              jakerpomperada@yahoo.com
              jakerpomperada@aol.com
*/

#include <stdio.h>

int main()
{
printf("\n\tThis\n\tis\n\ta\n\ttest\n\tonly.\n\n\tJake said, \"How are you Julianna?\"");
printf("\n\n");
printf("\tEnd of Program");
printf("\n\n");
}




Enum Statement in C

A very simple program that I wrote to show how to use enum statement in C 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

/* enum_example.c
  Enum Example Program
  Author   : Jake R. Pomperada,MAED-IT
  Tool     : Dev C++ Version 5.11
  Date    : November 19, 2018   Monday  10:25 AM
*/

#include <stdio.h>

int main()
{
enum MONTH {Jan=0,Feb,Mar};
enum MONTH month = Mar;
printf("\n\n");
     printf("\tEnum Program Demonstration");
     printf("\n\n");

  if (month == 0) {
printf("\tValue of January.");
} else if (month == 1) {
printf("\tMonth is February.");
}
if (month == 2) {
printf("\tMonth is March.");
}
printf("\n\n");
     printf("\tEnd of Program");
     printf("\n\n");
}




Sunday, June 16, 2019

Student Subject Grade Solver in PHP

A simple student subject grade solver that I wrote in PHP a very long time an ago while I am still a beginner in PHP programming.

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

index.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Grade Solver</title>
</head>

<body>
<form action="grade_result.php" method="post">
<table width="301" border="1">
  <tr>
    <td width="141">Enter Prelim:</td>
    <td width="144"><label>
      <input type="text" name="txtpre" id="textfield" />
    </label></td>
  </tr>
  <tr>
    <td>Enter Midterm:</td>
    <td><label>
      <input type="text" name="txtmid" id="textfield2" />
    </label></td>
  </tr>
  <tr>
    <td>Enter Semifinal:</td>
    <td><label>
      <input type="text" name="txtsem" id="textfield3" />
    </label></td>
  </tr>
  <tr>
    <td>Enter Final:</td>
    <td><label>
      <input type="text" name="txtfin" id="textfield4" />
    </label></td>
  </tr>
  <tr>
    <td><label>
      <input type="submit" name="submit" id="button" value="Compute" />
    </label></td>
    <td><label>
      <input type="reset" name="clear" id="button2" value="Clear" />
    </label></td>
  </tr>
</table>
<p>&nbsp;</p>
</form>
</body>
</html>


grade_result.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Grade Solver</title>
</head>

<body>
<?php
$pre = $_POST['txtpre'];
$mid = $_POST['txtpre']; 
$sem = $_POST['txtsem'];
$fin = $_POST['txtfin'];

$avg=($pre + $mid + $sem + $fin)/4;

if ($avg <=75)
{
$remarks="POOR";
}
else if (avg<=80)
{
$remarks="NI";
}
else if ($avg<=85)
{
$remarks="GOOD";
}
else if ($avg<=90)
{
$remarks="Excelent";
}
else 
{
$remarks="Outstanding";
}
?>


<table width="348" border="1">
  <tr>
    <td width="174">Prelim Grade:</td>
    <td width="158"><?php echo $pre; ?></td>
  </tr>
  <tr>
    <td>Midterm Grade:</td>
    <td><?php echo $mid; ?></td>
  </tr>
  <tr>
    <td>Semi-Final Grade:</td>
    <td><?php echo $sem; ?></td>
  </tr>
  <tr>
    <td>Final Grade:</td>
    <td><?php echo $fin; ?></td>
  </tr>
  <tr>
    <td>Your Average is:</td>
    <td><?php echo $avg; ?></td>
  </tr>
  <tr>
    <td>Your Remarks is:</td>
    <td><?php echo $remarks; ?></td>
  </tr>
</table>
</body>
</html>




Friday, June 14, 2019

Odd and Even Numbers Using Until Loop in Ruby

Write a program that will ask the user to give a number and then the program will list down the odd and even numbers using until loop statement.

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

# odd_even.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 14, 2019   Friday  1:55 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 "\tOdd and Even Numbers Using Until Loop ";
puts "\n\n"
print("\t");

print("Give a number : ");   
num_val = gets.chomp   
num_val = num_val.to_i;

print("\n");
print("\tList of Odd Numbers")
print("\n\n");
print("\t");

index = 1;
until index >= num_val 
    print(" #{index} ")
    index += 2;
end

print("\n\n");
print("\tList of Even Numbers")
print("\n\n");
print("\t");

index = 0;
until index >= num_val 
    print(" #{index} ")
    index += 2;
end


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




Square Numbers Using Until Loop Using Ruby

Write a program that will ask the user to give a number and then the program will list down the numbers and then its square number equivalent values using until loop statement.

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

# square.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 14, 2019   Friday  4:33 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 "\tSquare Numbers Using Until Loop ";
puts "\n\n"
print("\t");

print("Give a number : ");   
num_val = gets.chomp   
num_val = num_val.to_i;

print("\n");
print("\tNumber \t Square Number Equivalent");
print("\n\n");
index = 1;
until index >= num_val+1 
     print("\t");
     print(" #{index} \t\t  #{index**2}\n")
  index += 1;
end
print "\n";
print "\tEND OF PROGRAM";
print "\n\n";






Saturday, June 8, 2019

Introduction to C Programming Now available in Mindshapers Inc.

Almost all operating systems and embedded systems are created using C language. To learn more on C Programming our book entitled "Introduction to C Programming" can help you understand the C language with ease and confidence. For order kindly visit our publisher's website at www.mindshaperspublishing.com or send an email at mindshapersco@yahoo.com

People here in the Philippines can contact this number 0917 559 6000 look for Blesilda L. Chua   General  Manager 

Mindshapers Co. Inc.



Mindshapers Co, Inc.

Room 108, ICP Bldg., Recoletos St., Intramuros ManilaTelephone numbers: (02) 2546160Telefax: (02) 5276489
Email: mindshapersco@yahoo.com

Mobile Number : 0917 559 6000

Thank you very much. 




Tuesday, June 4, 2019

Find the Biggest Number Using Ruby


Design a program to find the maximum of the three numbers using nested if statement using Ruby 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

# biggest.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : May 25, 2019   Saturday  7:02 AM
# 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 "\tFind the Biggest Number";
puts "\n\n"
print "\tGive first value  : ";
a = gets.chomp
a = a.to_i;
print "\tGive second value : ";
b = gets.chomp
b = b.to_i;
print "\tGive third value  : ";
c = gets.chomp
c = c.to_i;
print "\n\n";
print "\t===== DISPLAY RESULT ====="
print "\n\n";
if (a >= b)
   if (a>= c) 
     print "\t#{a} is the largest number.";
   else
     print "\t#{c} is the largest number.";
end

elsif (b >= c)
   print "\t#{b} is the largest number.";
else
   print "\t#{c} is the largest number.";
end
print "\n\n";
print "\tEND OF PROGRAM";
print "\n\n";