Wednesday, September 12, 2018

Leap Year Checker Using Structure in C++

I this article I would like to share with you a sample program that will show how to use structure in C++ to check the leap year.

I am currently accepting programming work, it projects, 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 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.

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


Sample Program Output


Program Listing

// leap_year.cpp
// Author    : Mr. Jake R. Pomperada, BSCS,MAED-IT
// Date      : September 3, 2018   Monday  4:42 PM
// Location  : Bacolod City, Negros Occidental Philippines.
// Website   : http://www.jakerpomperada.com
// Email     : jakerpomperada@jakerpomperada.com and jakerpomperada@gmail.com
// Tool      : Dev C++ Version 5.11

#include <iostream>

using namespace std;

struct leap_year {
    int year;
};

int main()
{
struct leap_year years;
system("COLOR F0"); 
cout << "\n\n";
cout << "\tLeap Year Checker Using Structure";
cout <<"\n\n";
cout << "\tEnter Year : ";
cin >> years.year;
cout <<"\n";

if(years.year%4==0)
{
if(years.year%100==0)
{
if(years.year%400==0)
cout <<"\tThe Given Year " <<years.year << " is a Leap Year.";
else
cout <<"\tThe Give Year " <<years.year <<" Not a Leap Year.";
}
else
cout <<"\tThe Given Year " <<years.year <<" is a Leap Year.";
}
else {
  cout <<"\tThe Given Year " <<years.year<< " Not a Leap Year.";
}
cout <<"\n\n";
cout <<"\tEND OF PROGRAM";
cout <<"\n\n";
}









Nested Structure in C++

Here is a very simple program that I wrote to demonstrate how nested structure works in C++?

I am currently accepting programming work, it projects, 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 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.

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



Sample Program Output


Program Listing

// employees.cpp
// Author    : Mr. Jake R. Pomperada, BSCS,MAED-IT
// Date      : September 4, 2018   Tuesday  8:04 AM
// Location  : Bacolod City, Negros Occidental Philippines.
// Website   : http://www.jakerpomperada.com
// Email     : jakerpomperada@jakerpomperada.com and jakerpomperada@gmail.com
// Tool      : Dev C++ Version 5.11

#include <iostream>
#include <iomanip>

using namespace std;

struct contact_details    // structure tag
{
    char address[200];
int telephone;
    int mobile;
    char email[200];
};
struct emp             // structure tag
{
int empno;
char name[200];
char position[200];
contact_details user;
/* See, user is a structure variable itself (of type
      contact_details) and it is member of another structure,
   the emp structure. */
float basic;
};

int main()
{
emp user_details;   // create structure variable
system("COLOR F0"); 
cout <<"\n\n";
cout << fixed << setprecision(2);
cout << "\tNested Structure Demonstration in C++";
cout <<"\n\n";
cout<<"\tEmployee Number  : ";
cin>>user_details.empno;
cin.ignore();
cout<<"\tEmployee Name    : ";
gets(user_details.name);
cout<<"\tPosition         : ";
gets(user_details.position);
cout<<"\tBasic Salary     : PHP ";
cin >> user_details.basic;
cin.ignore();
cout<<"\tHome Address     : ";
gets(user_details.user.address);
cout<<"\tEmail Address    : ";
gets(user_details.user.email);
cout<<"\tTelephone Number : ";
cin>>user_details.user.telephone;
cout<<"\tMobile Number    : ";
cin >> user_details.user.mobile;
cout<<"\n\n";
cout<<"\tEMPLOYEE DISPLAY RECORD";
    cout <<"\n\n";
cout<<"\n\tEmployee Number     : "<<user_details.empno;
cout<<"\n\tEmployee Name       : "<<user_details.name;
cout<<"\n\tPosition            : "<<user_details.position;
cout<<"\n\tHome Address        : "<<user_details.user.address;
cout<<"\n\tEmail Address       : "<<user_details.user.email;
cout<<"\n\tTelephone Number    : "<<user_details.user.telephone;
cout<<"\n\tMobile Number       : "<<user_details.user.mobile;
cout<<"\n\tBasic Salary Pay    : PHP "<<user_details.basic;
cout<<"\n";
    cout <<"\n\n";
    cout <<"\tEND OF PROGRAM";
    cout <<"\n\n";
    system("pause");
}






Money Bill Denomination in JavaScript

In this article, I would like to share with you a program written by my student named Bliss Jay Gayon. I already ask permission to him to publish his work in my website which he agrees upon. I would like to thank Bliss for sharing this program with us. 

What the program does it will ask the user to give an amount and it will compute the bill denomination based on the amount given by the user using JavaScript.

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

<DOCTYPE html>
<html>
<head>
<style>

div{
    background-color: lightgrey;
    width: 500px;
    border: 25px solid green;
    padding: 25px;
    margin: 25px;
}
input
{
padding:8px;
display:block;
border:none;
border-bottom:1px solid #ccc;width:100%
}

</style>

</head>

<div>
<h1>Denomination</h1>
<h5>made bt: Bliss Jay Gayon (9/12/18)</h5>
  <label for="prelim">Prelim Grade </label>
    <input type="text" id="prelim" class="input" name="prelim" placeholder="Enter Amount">
  <button type="submit" class="input" onclick="myFunction()">Try it</button>
  

<p style="color:black;" id="demo"></p>

</div>


<script>
function myFunction() {
  var prelim = document.getElementById("prelim").value;
  var average = parseInt(prelim)/1000;
  var fivehundred = parseInt(prelim)/500;
  var twohundred = parseInt(prelim)/200;
  var onehundred = parseInt(prelim)/100;
  var fifty = parseInt(prelim)/50;
  var twenty = parseInt(prelim)/20;
  
  
  var n = average - (average % 1 );
  var a = fivehundred - (fivehundred % 1);
  var b = twohundred - (twohundred % 1);
  var c = onehundred - (onehundred % 1);
  var d = fifty - (fifty % 1);
  var e = twenty - (twenty % 1);
  
  document.getElementById("demo").innerHTML = " There Are " +n+ ", 1000 Bills and " +a+ ", 500 Bills  and " +b+ ", 200 Bills </br> and " +c+ ", 100 Bills  and " +d+ ", 50 Bills and " +e+ ", 20 Bills";
}
</script>
</form>

</body>
</html>




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");
}