Monday, September 3, 2018

Remove a Word From a String in C++

This is a very simple program that will ask the user to give a sentence and the program will remove the word in the given by the user in the sentence using C++.

I am currently accepting programming work, it project, school 

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 in my website kindly contact me also in my email address also. Thank you.
My email address are 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.

My personal website is http://www.jakerpomperada.com



Sample Program Output



Program Listing


// Author    : Mr. Jake R. Pomperada, BSCS,MAED-IT
// Date      : September 2, 2018   Sunday  9:58 PM
// Location  : Bacolod City, Negros Occidental Philippines.
// Website   : http://www.jakerpomperada.com
// Email     : jakerpomperada@jakerpomperada.com and jakerpomperada@gmail.com

#include <iostream>
#include <cstring>

using namespace std;
  
int main()
{
   char string[100], pattern[100];
   char *ptr;
   int length;
    
system("COLOR F0");  
cout << "\n\n";
    cout << "\tRemove a Word From a String";
    cout << "\n\n";
   cout << "\tEnter a string : ";
   cin.getline(string, 100);
   cout << "\n\n";
   cout << "\tEnter string to remove : ";
   cin.getline(pattern, 100);
   length = strlen(pattern);
   
   ptr = strstr(string, pattern);
      
   strcpy(ptr, ptr+length);
   cout << "\n\n";
   cout << "\tThe final result : " << string;
   cout << "\n\n";
   cout <<"\tEnd of Program";
   cout << "\n\n"; 
   return(0);
}


Friday, August 31, 2018

String Palindrome in C++

In this article I would like to share with you my more improve string palindrome program that I wrote using C++ for my upcoming book on C++ programming I hope you will find my work useful.

I am currently accepting programming work, it project, school 

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 in my website kindly contact me also in my email address also. Thank you.
My email address are 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.

My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

// palindrome.cpp
// Author    : Mr. Jake R. Pomperada, BSCS,MAED-IT
// Date      : August 31, 2018   Friday  9:32 PM
// Location  : Bacolod City, Negros Occidental Philippines.
// Website   : http://www.jakerpomperada.com
// Email     : jakerpomperada@jakerpomperada.com and jakerpomperada@gmail.com

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

#define size 50

 using namespace std;

 main()
    {
    char strsrc[size];
    char strtmp[size];
    char reply=0;
    do {
    system("cls");
    system("COLOR F0");  
    cout << "\n\n";
    cout << "\t\t PALINDROME CHECKER 1.0";
    cout << "\n\n";
    cout <<"\tEnter a String : => ";
        gets(strsrc);
    strcpy(strtmp,strsrc);
    strrev(strtmp);
    cout << "\n\n";
    if(strcmpi(strsrc,strtmp)==0) {
    cout << "\tEntered String " << strsrc << " is Palindrome.";
    }
    else {
    cout << "\tEntered String " << strsrc << " is Not Palindrome.";
    }
cout << "\n\n";
cout <<"\tDo You Want to Continue? Y/N : ";
reply = toupper(getch());
} while (reply =='Y');
cout << "\n\n";
cout <<"\tThank you for Using This Software !!!";
cout <<"\n\n";
system("PAUSE");
 }

Monday, August 27, 2018

One Dimensional Array Demonstration in C++

A very simple code that I have created to demonstrate how to use and declare one dimensional array using C++

I am currently accepting programming work, it project, school 

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 in my website kindly contact me also in my email address also. Thank you.
My email address are 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.

My personal website is http://www.jakerpomperada.com


Sample Program Output



Program Listing

// example_one.cpp
// Author    : Mr. Jake R. Pomperada,BSCS,MAED-IT
// Date      : August 27, 2018   Monday  7:43 AM
// Location  : Bacolod City, Negros Occidental Philippines.
// Website   : http://www.jakerpomperada.com
// Email     : jakerpomperada@jakerpomperada.com and jakerpomperada@gmail.com

#include <iostream>


using namespace std;

int main()
{
int score[5] = {5,10,15,20,25};
int a=0;
cout <<"\n\n";
cout <<"\tOne Dimensional Array Demonstration";
cout <<"\n\n";
for(a=0; a<5; a++)
{
cout<<"\tscore["<<a+1<<"] = "<<score[a]<<"\n";
}
cout <<"\n\n";
    system("pause");
}

Login With Text File in C++

A simple login system that I have created using C++ and Text file I am using Dev C++ in writing this code.

I am currently accepting programming work, it project, school 

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 in my website kindly contact me also in my email address also. Thank you.
My email address are 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.

My personal website is http://www.jakerpomperada.com



Sample Program Output



Program Listing

// login.cpp
// Author    : Mr. Jake R. Pomperada, BSCS,MAED-IT
// Date      : August 27, 2018   Monday  10:32 PM
// Location  : Bacolod City, Negros Occidental Philippines.
// Website   : http://www.jakerpomperada.com
// Email     : jakerpomperada@jakerpomperada.com and jakerpomperada@gmail.com

#include <iostream>
#include <fstream>
#include <cstring>
#include <conio.h>
#include <stdlib.h>

using namespace std

int start()
{
char login_password[50];
char stored_password[50];   
char login_username[50];
char stored_username[50];

fstream pull("users.txt",ios::in);
if (!pull) { 
    cout<<"File not loaded!"<<endl;
    return -1; 
}
system("COLOR F0");
cout <<"\n\n";
cout << "\tPassword Security With Text File in C++";
cout <<"\n\n";
cout<<"\tEnter Your Username: ";
cin>>login_username;

while(strcmp(login_username,stored_username)){ 

    pull>>stored_username;
    
    if (pull.eof()){  
    cout <<"\n\n"; 
        cout<<"\tUsername does not exist. "<<"\n";
        cout <<"\n\n";
        system("pause");
        return -1;  
    }
}
pull>>stored_password; 

cout<<"\tEnter Password: "; 
cin>>login_password;

while(strcmp(stored_password,login_password)){
    cout<<"\tWrong password. Please Try again? "<<"\n";
    cout<<"\tEnter Your Password :  ";
    cin>>login_password;
    start();
}
cout <<"\n\n";
cout<<"\tYou Login successfully !!!"<<"\n";
cout <<"\n\n";
cout <<"\tWelcome to the system.";
cout <<"\n\n";
system("pause");
return 0;

}


int main()
{
    start();
}   


the fist part is the username and the second column is the password in the users.txt text file

users.txt

jake pomperada
allie pomperada
jacob pomperada
julianna pomperada
lydia pomperada
admin admin
user password
1234 1234

Sunday, August 26, 2018

WORD BACKWARDS Version 1.0 in C++

A very simple program that will display the word given in backwards that I wrote in C++.

I am currently accepting programming work, it project, school 

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 in my website kindly contact me also in my email address also. Thank you.
My email address are 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.

My personal website is http://www.jakerpomperada.com


Program Listing

#include<iostream>
#include<string>


using namespace std;


main() {


string s;
int x;

  cout << "\n\n\t\t WORD BACKWARDS Version 1.0";
    cout << "\n\n\t Created By: Mr. Jake R. Pomperada, MAED-IT";
    cout << "\n\n";
 cout<<"Enter a word: ";

getline(cin, s);

   x = s.length()-1;
 cout <<"\n\n Original Word     :=> " << s;
 cout << "\n\n After Backwards  :=> " ;
while(x >= 0 ){
     cout<< s[x];
     x--;
   }
   cout << "\n\n";
   system("pause");
}



Character Counter Version 1.0 in C++

A very simple character counter that I wrote a long time ago in C++ that will count the vowels, consonants, digits and spaces if else statement.

I am currently accepting programming work, it project, school 

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 in my website kindly contact me also in my email address also. Thank you.
My email address are 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.

My personal website is http://www.jakerpomperada.com


Program Listing

#include <iostream>

using namespace std;

main() {
    int digits=0, vowels=0,consonants=0,spaces=0;
    char c;

    cout << "\n\t Character Counter Version 1.0";
    cout << "\n\n";
    cout << "\t Developed By: Jake R. Pomperada,MAED-IT";
    cout << "\n\n";
    cout << "Enter a Sentence : ";
    while ((c= getchar()) != '\n') {

    if (c == 'a' || c == 'A'  ||
        c == 'e' || c == 'E' ||
        c == 'o' || c == 'O' ||
        c == 'i' || c == 'I' ||
        c == 'u' || c == 'U' )
        {
        vowels++;
        }
   if (c == 'b' || c == 'B'  ||
        c == 'c' || c == 'C' ||
        c == 'd' || c == 'D' ||
        c == 'f' || c == 'F' ||
        c == 'g' || c == 'G' ||
        c == 'h' || c == 'H' ||
        c == 'j' || c == 'J' ||
        c == 'k' || c == 'K' ||
        c == 'l' || c == 'L' ||
        c == 'm' || c == 'M' ||
        c == 'n' || c == 'N' ||
        c == 'p' || c == 'P' ||
        c == 'q' || c == 'Q' ||
        c == 'r' || c == 'R' ||
        c == 's' || c == 'S' ||
        c == 't' || c == 'T' ||
        c == 'v' || c == 'V' ||
        c == 'w' || c == 'W' ||
        c == 'x' || c == 'X' ||
        c == 'y' || c == 'Y' ||
        c == 'z' || c == 'Z' )

         {
       consonants++;
      }


        if (c =='0' || c == '1' ||
         c =='2' || c == '3'
         || c =='4' || c == '5' ||
           c =='6' || c == '7' ||
           c =='8' || c == '9'  ) {
     digits++;
           }


     if (c == ' ') {
         spaces++;
     }

    }
    cout << "\nNo. of Digits " << digits << ".";
    cout << "\nNo. of Vowels " << vowels << ".";
    cout << "\nNo. of Consonants " << consonants << ".";
     cout << "\nNo. of Spaces " << spaces << ".";
    cout << "\n\n";
    system("pause");
}

Count Vowel, Consonants, Digits and Whitespace in C++

In this program will ask the user to give a sentence and then the program using switch statement will count the vowels, consonants, digits and white space using C++.

I am currently accepting programming work, it project, school 

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 in my website kindly contact me also in my email address also. Thank you.
My email address are 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.

My personal website is http://www.jakerpomperada.com


Program Listing

#include <iostream>
#include <string>

using namespace std;


main()  {
    string sentence;
    int NumChars=0, VowelCount=0, ConsonantCount=0;
    int whitespace=0, digits=0;

    cout << "Enter a String :=> ";
    getline(cin,sentence);

    NumChars = sentence.length();

    for (int i=0; i < NumChars; i++) {
          switch(sentence.at(i)) {

              case 'a' : case 'A' :
              case 'e' : case 'E' :
              case 'i' : case 'I' :
              case 'o' : case 'O' :
              case 'u' : case 'U'  : VowelCount++;
                                     break;
              case 'b' : case 'B' :
              case 'c' : case 'C' :
              case 'd' : case 'D' :
              case 'f' : case 'F' :
              case 'g' : case 'G' :
              case 'h' : case 'H'  :

              case 'j' : case 'J'  :
              case 'k' : case 'K' :
              case 'l' : case 'L' :
              case 'm' : case 'M' :
              case 'n' : case 'N' :
              case 'p' : case 'P'  :

              case 'q' : case 'Q' :
              case 'r' : case 'R' :
              case 's' : case 'S' :
              case 't' : case 'T' :
              case 'w' : case 'W'  :

              case 'x' : case 'X' :
              case 'y' : case 'Y' :
              case 'z' : case 'Z' :  ConsonantCount++;
                                     break;
              case '  '  : whitespace++;
                           break;
              case '1' : case '2' :
              case '3' : case '4' :
              case '5' : case '6' :
              case '7' : case '8' :
              case '9' : case '0'  : digits++;



          }
    }
    cout << "\n\n";
    cout << " \n ===  SUMMARY OF REPORTS ===== ";
    cout << "\n\n";
    cout << "\nNumber of Vowels     :=> " << VowelCount << ".";
    cout << "\nNumber of Consonants :=> " << ConsonantCount << ".";
    cout << "\nNumber of Digits     :=> " << digits << ".";
    cout << "\nNumber of WhiteSpce  :=> " << whitespace << ".";
    cout << "\n\n";
    system("PAUSE");
}

Running Sum using Pointers in C++

A very simple program that I wrote along time ago while learning C++ programming in my class in one of the university here in Bacolod City. This program will ask the user to give a number and then it will sum up the total numbers using Pointers in C++.

I am currently accepting programming work, it project, school 

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 in my website kindly contact me also in my email address also. Thank you.
My email address are 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.

My personal website is http://www.jakerpomperada.com


Program Listing

#include<iostream.h>

#include<conio.h>

int main()
{
int array[30];
int sum=0,n=0,*point;
cout << "\t\tRunning Sum Using Pointers";
cout << "\n\n";
cout<<"Enter how many elements ?";
cin>>n;
for(int i=1;i<=n;i++) {
 cout << "\n\n";
 cout << "Enter Value No"
     << i << ":";
cin>>array[i];
point = &array[i];
sum+=array[i];
cout << "\n";
cout<<"The Running Sum is "
    << sum << ".";

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

}