Sunday, June 7, 2020

Real Fancy in C++

A program was written by my friend Thomas to test real fancy in C++. Thank you Thomas for sharing your code to us.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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 City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.https://www.unlimitedbooksph.com/

Program Listing

/*
Chef was reading some quotes by great people.
Now, he is interested in classifying all the fancy quotes
he knows. He thinks that all fancy quotes which contain
the word "not" are Real Fancy;
quotes that do not contain it are regularly fancy.
You are given some quotes.
For each quote, you need to tell Chef if it is Real Fancy
or just regularly fancy.

https://www.codechef.com/problems/FANCY
*/

#include <iostream>
#include <string>
#include <cstdio>
#include <sstream>

const std::size_t MAX_INPUT_LENGTH = 100;

inline void do_test()
{
  std::string input;
  input.reserve(MAX_INPUT_LENGTH);
  std::getline(std::cin, input);
  std::istringstream iss(input);
  std::string token;
  while (iss >> token)
  {
    if (token == "not")
    {
      std::cout << "Real Fancy\n";
      return;
    }
  }

  std::cout << "regularly fancy\n";
}

int main()
{
  int num_tests;

#ifdef ONLINE_JUDGE
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
#else
  std::freopen("input.txt", "r", stdin);
#endif

  std::cin >> num_tests;
  std::cin.ignore(255, '\n');

  for (int n = 0; n < num_tests; n++)
  {
    do_test();
  }
}





Calculate Average of Numbers Using Array in C


A program written by my friend and fellow software engineer Sir Ernel. Thank you Sir Ernel for sharing your program with us.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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 City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.https://www.unlimitedbooksph.com/

Program Listing


#include <stdio.h>
int main()
{
    int n, i;
    float num[100], sum=0.0, average;
    printf("Enter the numbers of data: ");
    scanf("%d",&n);
    while (n>100 || n<=0)
    {
        printf("Error! number should in range of (1 to 100).\n");
        printf("Enter the number again: ");
        scanf("%d",&n);
    }
   for(i=0; i<n; ++i)
   {
      printf("%d. Enter number: ",i+1);
      scanf("%f",&num[i]);
      sum+=num[i];
   }
   average=sum/n;
   printf("Average = %.2f",average);
   return 0;
}


Paper-Rock and Scissor Game in C

A game called Paper-Rock and Scissors written and given to us by my friend and fellow software engineer Sir Ernel. Thank you so much Sir Ernel.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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 City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.https://www.unlimitedbooksph.com/

Program Listing


/* Paper-Rock and Scissor Game in C */
#include <stdio.h>
int main ()
{
char p1, p2;
printf("\n       Welcome to Rock-Paper-Scissor Game\n");
printf("\nInstructions: \n Enter [r]rock [p]paper [s]scissor \n");
printf ("\n Enter Player 1: ");
do{
scanf("%c",&p1);
if(p1!='p' && p1!='P' && p1!='s' && p1!='S' && p1!='r' && p1!='R')
{
if(p1!='\n')
printf("\a\nInvalid character %c \nPlease enter valid character r,p,s only\n",p1);
}
}
while(p1!='p' && p1!='P' && p1!='s' && p1!='S' && p1!='r' && p1!='R');
printf ("\n Enter Player 2: ");
do {
scanf("%c",&p2);
if(p2!='p' && p2!='P' && p2!='s' && p2!='S' && p2!='r' && p2!='R') {
if(p2!='\n')
printf("\a\nInvalid character %c \nPlease enter valid character r,p,s only\n",p2);
}
}
while(p2!='p' && p2!='P' && p2!='s' && p2!='S' && p2!='r' && p2!='R');
if (((p1=='p')||(p1=='P')) && ((p2=='R') || (p2=='r'))) {
printf ("\n Player 1 Wins !");
printf ("\n Paper Covers Rock");
}
else 
if (((p2=='p') || (p2=='P')) && ((p1=='r') || (p1=='R'))) {
printf ("\n Player 2 Wins !");
printf ("\n Paper Covers Rock");
}
else 
if (((p1=='r') || (p1=='R')) && ((p2=='s') || (p2=='S'))) {
printf ("\n Player 1 Wins !");
printf ("\n Rock Breaks Scissors");
}
else 
if (((p2=='r') || (p2=='R')) && ((p1=='s') || (p1=='S'))) {
printf ("\n Player 2 Wins !");
printf ("\n Rock Breaks Scissors");
}
else 
if (((p1=='s') || (p1=='S')) && ((p2=='p') || (p2=='P'))) {
printf ("\n Player 1 Wins !");
printf ("\n Scissors Cut Paper");
}
else 
if (((p2=='s') || (p2=='S')) && ((p1=='p') || (p1=='P'))) {
printf ("Player 2 Wins !");
printf ("Scissors Cut Paper");
}
else 
if (p1==p2) {
printf ("\n Nobody Wins !");
printf ("\n Both Of You Entered The Same Letters");
}
return 0;
}

Wednesday, June 3, 2020

Temperature Checker in C++

A simple program that I wrote using C++ to ask the user to give a temperature and then the program will check the type of temperature based on the given value of the user using if-else if statement.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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 City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.https://www.unlimitedbooksph.com/

Program Listing

#include<iostream>
#include<conio.h>

using namespace std;

int main()
{
    int temp;
    cout << "Enter temperature: ";
    cin >> temp;
    if((temp>=31)&&(temp<=50))
        cout << "VERY HOT";
    else if((temp>=21)&&(temp<=30))
        cout << "WARM";
    else if((temp>=11)&&(temp<=20))
        cout << "VERY COLD";
    else if((temp>=0)&&(temp<=10))
        cout << "FREEZING";
    getch();
    return 0;
}    

Area of the Triangle in C++

A simple program that I wrote that will ask the user to give base and height value to compute the are of the triangle using a C++ programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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 City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.https://www.unlimitedbooksph.com/

Program Listing

#include<iostream>
#include<cstdlib>

using namespace std;

int main()
{
    double b,h;

    cout<<"Area of a Triangle Solver"<<endl;
    cout<<"base  : "; 
cin>>b;
    cout<<"height: "; 
cin>>h;
    cout<<"area = "
        <<(b*h)/2
        <<" square units "
        <<endl;

    system("pause");
return 0;
}

Linear Search Using C#

A linear search program was written by my friend Tom that uses C# programming language. Thank you Tom for sharing your code to us.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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 City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com


My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below. https://www.unlimitedbooksph.com/

Program Listing

/*
The program will ask the use to give for example five numbers
and then the program will  ask the user what number to search
and the program will find the number and what position the number
is Located in.

Compiler / IDE: VS 2017 CE
*/

using System;

namespace ConsoleApp1
{
   class Program
   {
     static void Main(string[] args)
     {
       const int N = 5;
       int[] numbers = new int[N];
       int num_to_search;
       string buffer;

       for (int i = 0; i < N; ++i)
       {
         Console.Write($"Enter number #{i+1}: ");
         buffer = Console.ReadLine();
         numbers[i] = int.Parse(buffer);
         Console.WriteLine();
       }
       Console.WriteLine("Enter number to search: ");
       buffer = Console.ReadLine();
       num_to_search = int.Parse(buffer);

       int idx = Array.IndexOf(numbers, num_to_search);
       if (idx == -1)
         Console.WriteLine("Number not found");
       else
         Console.WriteLine($"Found number {num_to_search} at pos {idx}");

       Console.ReadKey();
     }
   }
}



Linear Search Using Modern C++

A linear search program was written by my friend Tom that uses modern C++ approach.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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 City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com


My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below. https://www.unlimitedbooksph.com/

Program Listing

/*
The program will ask the use to give for example five numbers
and then the program will  ask the user what number to search
and the program will find the number and what position the number
is Located in.
*/

#include <iostream>
#include <vector>
#include <algorithm>

constexpr int N = 5;

int main()
{
   std::vector<int> numbers(N);
   int num_to_search;

   for (int i = 0; i < N; ++i)
   {
     std::cout << "Enter number #" << i + 1 << ": ";
     std::cin >> numbers[i];
     std::cout << '\n';
   }
   std::cout << "Enter a number to search for: ";
   std::cin >> num_to_search;

   //http://www.cplusplus.com/reference/algorithm/find/
   auto it = std::find(numbers.begin(), numbers.end(), num_to_search);
   if (it == numbers.end())
   {
     std::cout << "Number not found";
   }
   else
   {
     //http://www.cplusplus.com/reference/iterator/distance/
     std::cout << "Found at pos: " << std::distance(numbers.begin(), it);
   }
}

Sunday, May 31, 2020

Remove Vowels in Java

I wrote this program to ask the user to give string and then the program to remove the vowels in the given string using Java programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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 City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com


My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below. https://www.unlimitedbooksph.com/

Program Listing

// demo.java
// Written By: Jake Rodriguez Pomperada
// Barangay Alijis, Bacolod City, Negros Occidental Philippines.
// www.jakerpomperada.com
// jakerpomperada@gmail.com
// May 14, 2020  Thursday

package test;

import java.util.Scanner;

public class demo {

   static String Remove_Vowels(String str)
   {
    return  str.replaceAll("[AIEOUaieou]","" );
   }
public static void main(String[] args) {
     
Scanner input = new Scanner(System.in);
     
     String str_given,display_result;
     
    System.out.print("\n\n");
    System.out.print("\tRemove Vowels in Java");
    System.out.print("\n\n");
    System.out.print("\tGive a String : ");
    str_given = input.nextLine();
    
    System.out.print("\n"); 
    System.out.print("\tString : " + str_given);
    display_result = Remove_Vowels(str_given);
    System.out.print("\n");
    System.out.print("\tResult : " + display_result);
    System.out.println();  
}

}

Remove Consonants in Java

I wrote this program to ask the user to give string and then the program to remove the consonants in the given string using Java programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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 City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com


My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below. https://www.unlimitedbooksph.com/

Program Listing

// demo.java
// Written By: Jake Rodriguez Pomperada
// Barangay Alijis, Bacolod City, Negros Occidental Philippines.
// www.jakerpomperada.com
// jakerpomperada@gmail.com
// May 14, 2020  Thursday

package test;

import java.util.Scanner;

public class demo {

   static String Remove_Consonants(String str)
   {
    return  str.replaceAll("[BCDFGHJKLMNPQRSTVXZbcdfghjklmnpqrstvxz]","" );
   }
public static void main(String[] args) {
     
Scanner in = new Scanner(System.in);
     
     String str_given,display_result;
     
    System.out.print("\n\n");
    System.out.print("\tRemove Consonants in Java");
    System.out.print("\n\n");
    System.out.print("\tGive a String : ");
    str_given = in.nextLine();
    
    System.out.print("\n"); 
    System.out.print("\tString : " + str_given);
    display_result = Remove_Consonants(str_given);
    System.out.print("\n");
    System.out.print("\tResult : " + display_result);
    System.out.println();  
}

}

Friday, May 29, 2020

ISANG CERTIFIED NA SEAMANLOLOKO. PANUORIN!

Shell Sort Using C++ STL

Here is a shell sort program was written by my good friend Tom from the United Kingdom using C++ STL. Thank you Tom for sharing your code to us.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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 City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.
https://www.unlimitedbooksph.com/


Program Listing

#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>

using namespace std;

enum class SortOrder
{
   Ascending,
   Descending
};

// based on https://gist.github.com/svdamani/dc57e4d1b00342d4507d
template <class Iter>
inline void selection_sort(Iter first, Iter last, SortOrder order)
{
   while (first != last)
   {
     if (order == SortOrder::Ascending)
       std::iter_swap(first, std::min_element(first, last));
     else
       std::iter_swap(first, std::max_element(first, last));

   ++first;
   }
}

int main()
{
   cout << "Original vector of Numbers\n";
   vector<int> v = { 2, 1, 5, 10, 3 };
   copy(begin(v), end(v), ostream_iterator<int>(cout, " "));

   cout << "\n\nVector sorted in ascending order:\n";
   selection_sort(begin(v), end(v), SortOrder::Ascending);
   copy(begin(v), end(v), ostream_iterator<int>(cout, " "));

   cout << "\n\nVector sorted in descending order:\n";
   selection_sort(begin(v), end(v), SortOrder::Descending);

   copy(begin(v), end(v), ostream_iterator<int>(cout, " "));

   cout << "\n\n";
   system("PAUSE");
}



Selection Sort in C++ Using STL

I wrote this selection sort program using C++ STL I hope you will find my work useful.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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 City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.
https://www.unlimitedbooksph.com/


Program Listing

#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>

using namespace std;

template<class T>
void SelSort(vector<T> & v, size_t start, size_t stop)
{
   size_t begin = start;
   size_t smallsofar = begin;
   if (start < stop)
   {
     for (size_t i = begin + 1; i <= stop; i++)
     {
       if (v[i] < v[smallsofar])
         smallsofar = i;
     }
     swap(v[begin], v[smallsofar]);
     SelSort(v, start + 1, stop);
   }
}

template<class T>
void SelSort(vector<T> & v)
{
   if(!v.empty())
     SelSort(v, 0, v.size() - 1);
}

int main()
{
   cout << "\t\t\t SELECTION SORT IN C++";
   cout << "\n\t\t Created By: Mr. Jake R. Pomperada, MAED-IT";
   cout << "\n\n";

   cout << "\n\t Original Arrangement of Numbers";
   cout << "\n\n";

   vector<int> v = { 2, 1, 5, 10, 3 };
   copy(begin(v), end(v), ostream_iterator<int>(cout, " "));

   SelSort(v);

   cout << "\n";
   cout << "\n\t Sorted Arragmenent of Number";
   cout << "\n\n";

   copy(begin(v), end(v), ostream_iterator<int>(cout, " "));

   cout << "\n\n";
   system("PAUSE");
}

Thursday, May 28, 2020

Wowowin: Paano naging Kapuso si Kuya Wil?

Francis Leo Marcos|News Update Gen.Guillermo Eleazar nag salita na?

Reverse the given String in Perl

I wrote this program using Perl programming language to ask the user to give a string and then the program will reverse the given string by the user.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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 City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.
https://www.unlimitedbooksph.com/


Program Listing

# reverse_string.pl
# Author   : Jake R. Pomperada,MAED-IT,MIT
# Date     : April 9, 2020   Wednesday 5:56 AM
# Location : Bacolod City, Negros Occidental
# Email    : jakerpomperada@gmail.com
# Website  : http://www.jakerpomperada.com

  

    print("\n");
    print("\tReverse the given String in Perl");
    print("\n\n");
    print("\tEnter a String : ");
    chomp($str=<STDIN>);

    $string =  ucfirst($str);
    $reverse_word = reverse($string);

    print("\n");
    print("\tString given          : $str");
    print("\n\n");
    print ("\tReverse Word         : $reverse_word\n"); 
    print("\n\n");
    print("\t\tEnd of Program");
    print("\n\n");

Tuesday, May 26, 2020

Ordinal Numbers in PHP

A simple program that I wrote to demonstrate ordinal numbers using PHP programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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 City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.
https://www.unlimitedbooksph.com/



Sample Program Output


Program Listing

index.php


<html>
  <head>
    <title>Ordinal Numbers in PHP </title>
  </head>
  <style type="text/css">
    body {
      font-family: arial;
      size: 15px;
    }
  </style>
 <body>
  <h2> Ordinal Numbers in PHP </h2>
<?php

  function OrdinalNumberSuffix($num) {
    if (!in_array(($num % 100),array(11,12,13))){
      switch ($num % 10) {
        // Handle 1st, 2nd, 3rd
        case 1:  return $num.'st';
        case 2:  return $num.'nd';
        case 3:  return $num.'rd';
      }
    }
    return $num.'th';
  }


for ($i = 1; $i <= 255; $i++){
  echo OrdinalNumberSuffix($i) . "\t";
  if ($i % 10 == 0) {
    echo "\n";
  }
}

?>
</body>
</html>

Ordinal Numbers Using Pascal

   As I learned computer programming my first programming language that I have learned is Pascal the compiler that I am using during those days in college in Turbo Pascal 5.0. In this program I would like to reminisce the past by writing a program using Pascal as my programming language to accept a number from the user and then convert the number into ordinal equivalent values. In this sample program I am using Turbo Pascal 5.5 that is widely available right now to download free from any charges over the Internet. This problem I encounter during my college days in our programming class.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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 City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.
https://www.unlimitedbooksph.com/


Program Listing

    
    (* Ordinal_Numbers.pas*)
    (* Written By Mr. Jake R. Pomperada, MAED-IT *)
    (* Tools : Turbo Pascal 5.5. For DOS *)
    (* Date : November 24, 2015 *)
    Program Ordinal_Numbers;
    Uses Crt;
    Var number : integer;
    message : string;
    a: integer;
    mod100 : integer;
    mod10: integer;
    begin
    a:=0; mod10:=0; mod100:=0;
    clrscr;
    textcolor(yellow);
    write('Ordinal Number Generator in Pascal');
    writeln; writeln; writeln;
    write('Enter a Number : ');
    readln(number);
    writeln; writeln;
    for a:= 1 To number Do
    Begin
    mod10 := (a mod 10);
    mod100 := (a mod 100);
    if (mod10 = 1) AND (mod100 <> 11) then
    Begin
    message := 'st';
    End
    else if (mod10 = 2) AND (mod100 <> 12) then
    Begin
    message := 'nd';
    End
    else if (mod10 = 1) AND (mod100 <> 11) then
    Begin
    message := 'rd';
    End
    else
    Begin
    message := 'th';
    End;
    write(' ',a,message,' ');
    End;
    writeln; writeln;
    write('End of Program');
    readln;
    End.