Thursday, August 15, 2019

ABC Payroll System in C++

A very simple payroll system that I wrote a long time ago in C++.

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 <iomanip>


using namespace std;

main() {

 int age[2];
double salary[2],total_salary=0;
char name[15];

  cout << "\n\t ===  ABC Payroll System Version 1.0 === ";
  cout <<"\n\n";
  for (int a=0; a<3; a++) {
      cout << "\n";
      cout << "Enter Employees Name   : ";
      cin >> name[a];
      cout << "Enter Employees Age    : ";
      cin >> age[a];
      cout << "Enter Employees Salary : ";
      cin >> salary[a];
  }
  cout << "\n\n";
  cout << "\t ==== SUMMARY OF REPORT ==== ";
  cout << "\n";
cout << fixed;
  for (int a=0; a<3; a++) {
      cout << "\n Name   : " << name[a] << setw(8)
        << "Age : " <<age[a] << setw(12)
          << "Salary : " <<setprecision(2)
          << salary[a];
    total_salary+= salary[a];
  }
   cout << "\n\n";
   cout << "\n Total Salary => $" <<
       total_salary;
      cout << "\n\n";
      //system("PAUSE");

}






Tic Tac Toe Program in C++

A simple Tic Tac Toe program is written using C++ 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



Program Listing

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

char matrix[3][3];//={0};
void cou(void);


int main()
{

int m,n;
char ch='y';
while(ch=='Y'||ch=='y'){
system("cls");
for (m=0;m<3;m++)for (n=0;n<3;n++)matrix[m][n]= '\0';
int i,j,sum=0;
while ( sum < 10){
if (sum == 0) cou();
cout<<"Player 1 is 'X': choose the row and column"<<endl;
cout<<"Row : ";
cin>>i;
cout<<"Column : ";
cin>>j;
for (;i>3 || i<1 || j>3 || j<1 ||('X'==matrix[i-1][j-1]||'O'==matrix[i-1][j-1]);) {cout<<"Sorry boy, but you gotta choose another place.\n";cout<<"row : ";cin>>i;cout<<"column : ";cin>>j;}
matrix[i-1][j-1]='X';
sum++;
cou();

//check if wins
if (matrix[0][0]=='X' && matrix[0][0]==matrix[1][1] && matrix[1][1]==matrix[2][2]) {cout<<"Player 1 wins"<<endl;break;}
if (matrix[2][0]=='X' && matrix[2][0]==matrix[1][1] && matrix[1][1]==matrix[0][2]) {cout<<"Player 1 wins"<<endl;break;}
if (matrix[0][0]=='X' && matrix[0][0]==matrix[1][0] && matrix[1][0]==matrix[2][0]) {cout<<"Player 1 wins"<<endl;break;}
if (matrix[0][1]=='X' && matrix[0][1]==matrix[1][1] && matrix[1][1]==matrix[2][1]) {cout<<"Player 1 wins"<<endl;break;}
if (matrix[0][2]=='X' && matrix[0][2]==matrix[1][2] && matrix[1][2]==matrix[2][2]) {cout<<"Player 1 wins"<<endl;break;}
if (matrix[0][0]=='X' && matrix[0][0]==matrix[0][1] && matrix[0][1]==matrix[0][2]) {cout<<"Player 1 wins"<<endl;break;}
if (matrix[1][0]=='X' && matrix[1][0]==matrix[1][1] && matrix[1][1]==matrix[1][2]) {cout<<"Player 1 wins"<<endl;break;}
if (matrix[2][0]=='X' && matrix[2][0]==matrix[2][1] && matrix[2][1]==matrix[2][2]) {cout<<"Player 1 wins"<<endl;break;}

if (sum == 9){cout<<"The game is over and no one wins, hahaha, you both stink!!!"<<endl; break;} //sum=9 because there are only 9 boxes in the game
//player 2's turn

cout<<"Player 2 is 'O': choose the row and column"<<endl;
cout<<"Row : ";
cin>>i;
cout<<"Column : ";
cin>>j;
for (;i>3 || i<1 || j>3 || j<1 ||('X'==matrix[i-1][j-1]||'O'==matrix[i-1][j-1]);) {cout<<"Sorry boy, but you gotta choose another place.\n";cout<<"row : ";cin>>i;cout<<"column : ";cin>>j;}
matrix[i-1][j-1]='O';
sum++;
//the play box
cou();
//check if wins
if (matrix[0][0]=='O' && matrix[0][0]==matrix[1][1] && matrix[1][1]==matrix[2][2]) {cout<<"Player 2 wins"<<endl;break;}
if (matrix[2][0]=='O' && matrix[2][0]==matrix[1][1] && matrix[1][1]==matrix[0][2]) {cout<<"Player 2 wins"<<endl;break;}
if (matrix[0][0]=='O' && matrix[0][0]==matrix[1][0] && matrix[1][0]==matrix[2][0]) {cout<<"Player 2 wins"<<endl;break;}
if (matrix[0][1]=='O' && matrix[0][1]==matrix[1][1] && matrix[1][1]==matrix[2][1]) {cout<<"Player 2 wins"<<endl;break;}
if (matrix[0][2]=='O' && matrix[0][2]==matrix[1][2] && matrix[1][2]==matrix[2][2]) {cout<<"Player 2 wins"<<endl;break;}
if (matrix[0][0]=='O' && matrix[0][0]==matrix[0][1] && matrix[0][1]==matrix[0][2]) {cout<<"Player 2 wins"<<endl;break;}
if (matrix[1][0]=='O' && matrix[1][0]==matrix[1][1] && matrix[1][1]==matrix[1][2]) {cout<<"Player 2 wins"<<endl;break;}
if (matrix[2][0]=='O' && matrix[2][0]==matrix[2][1] && matrix[2][1]==matrix[2][2]) {cout<<"Player 2 wins"<<endl;break;}

}
cout<<"\nWould you like to play again??? (Y - N)\n";
cin>>ch;
}
      system("PAUSE");
      return 0;
}


void cou(void)
{
//the play box

cout << "\n\n";
cout<<"\n\t\t                1   2   3\n"<<endl;
cout<<"\t\t             1  "<<matrix[0][0]<<" | "<<matrix[0][1]<<" | "<<matrix[0][2]<<endl;
cout<<"\t\t               ---|---|---\n";
cout<<"\t\t             2  "<<matrix[1][0]<<" | "<<matrix[1][1]<<" | "<<matrix[1][2]<<endl;
cout<<"\t\t               ---|---|---\n";
cout<<"\t\t             3  "<<matrix[2][0]<<" | "<<matrix[2][1]<<" | "<<matrix[2][2]<<"\n\n\n";
}

Password Program in C++

A very simple password program that I wrote before in C++.

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 <conio.h>
#include <string>

using namespace std;

const int PASSLEN = 4;

string passget();


void start()
{

string password;
cout << "\n\n";
cout << "\t PASSWORD SECURITY VERSION 1.0";
cout << "\n\n";
cout << "Enter Your Password: ";
password = passget();

if (password == "jake") {
    cout << "\n\n";
    cout << "Password Accepted";
    cout << "\n\n\n";
    cout << "\t\t Thank You For Using this Software";

}
else {
    cout << "\n\n";
    cout << "Password Denied Try Again !!!";
    start();
}
}  // End of Start Function


int main()
{
    start();
getch();
}

string passget()
{
char password[PASSLEN], letter;
int loop;
int len;
string password2;

//Get Password and replace letters with *--------------
loop = 0;
while(loop != PASSLEN)
{
password[loop] = '\0';
loop++;
}
loop = 0;
len = 0;
letter = '\0';
while( letter != '\r' )
{
letter = getch();
if( letter == '\b' && password[0] == '\0')
{
loop = 0;
len = 0;
}
else
{
if( letter == '\b' && password[0] != '\0')
{
cout << "\b";
cout << " ";
cout << "\b";
loop--;
password[loop] = '\0';
len--;
}
else
{
if( isprint( letter ) != 0 && loop < PASSLEN)
{
password[loop] = tolower(letter);
cout << "*" ;
}
loop++;
if (loop <= PASSLEN)
len++;
}
}
}

//Convert Password from character array to string
loop = 0;
len = len;
password2 = "";
while (loop != len)
{
password2 = password2+password[loop];
loop++;
}

return password2;
 } // End of Function Password

How to write a text file in C++

Here is a copy that will give you some idea how to write a text file in C++.

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

// writing on a text file in C++

#include <iostream>
#include <fstream>

using namespace std;

int main () {
  ofstream myfile ("example.txt");
  string text;
  text = "This is a test content.testing";
  if (myfile.is_open())
  {
    myfile<<text;
    myfile.close();
  }
  else cout << "Unable to open file";
  return 0;
}

Simple Geometric Calculator in C++

In this article a simple geometric calculator written in C++. The code shows you how to create a menu-driven program and the use of conditional statements in C++.

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>

using namespace std;

int main(){
    int choice;
    cout<<"-- Simple Geometric Calculator --"<<endl;
    cout<<"- 1. Perimeter of Square       --"<<endl;
    cout<<"- 2. Perimeter of Rectangle    --"<<endl;
    cout<<"- 3. Area of Square            --"<<endl;
    cout<<"- 4. Area of Rectangle         --"<<endl;
    cout<<"---------------------------------"<<endl;
    cout<<"What is my choice :>";cin>>choice;
    if (choice==1)
    {
        double s,ps;
        cout<<"You have chosen Perimeter of Square"<<endl;
        cout<<"Enter side of Square :"; cin>>s;
        ps = 4*s;
        cout<<"Perimeter of Square is :"<<ps<<endl;
    }
    else if (choice==2)
    {
        double pl,ph,pr;
        cout<<"You have chosen Perimeter of Rectangle"<<endl;
        cout<<"Enter length of Rectangle :"; cin>>pl;
        cout<<"Enter height of Rectangle :"; cin>>ph;
        double setr = pl+ph;
        pr = setr*2;
        cout<<"Perimeter of Rectangle is :"<<pr;
    }
    else if (choice==3)
    {
        double ss,as;
        cout<<"You have chosen Area of Square"<<endl;
        cout<<"Enter side of Square :"; cin>>ss;
        as = ss * ss;
        cout<<"Area of Square is :"<<as;
    }
    else if (choice==4)
    {
        double al,ah,ar;
        cout<<"You have chosen Area of Rectangle"<<endl;
        cout<<"Enter length of Rectangle :"; cin>>al;
        cout<<"Enter height of Rectangle :"; cin>>ah;
        ar = al*ah;
        cout<<"Area of Rectangle is :"<<ar;
    }
return 0;
}


Student Class Grade in C++

A simple student class grade solver that I wrote in C++ a long time ago while I am learning the 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



Program Listing

#include<iostream>
#include<string>

using namespace std;

int main()
{
    string fName;
    string lName;
    string course;
    string section;
    int quizzes, attedance, exam;
    cout<<"-- Student's Data Entry Form --"<<endl;
    cout<<"First Name :";cin>>fName;
    cout<<"Last Name  :";cin>>lName;
    cout<<"Course     :";cin>>course;
    cout<<"Section    :";cin>>section;
    cout<<"Student's Grading Form"<<endl;
    cout<<"Quizzes    :";cin>>quizzes;
    cout<<"Attendance :";cin>>attedance;
    cout<<"Exams      :";cin>>exam;
    double grade;
    grade = (quizzes*.3+attedance*.3+exam*.4);
    system("cls");
    cout<<"-- Student Information Form --"<<endl;
    cout<<"First Name :"<<fName<<endl;
    cout<<"Last Name  :"<<lName<<endl;
    cout<<"Course     :"<<course<<" & Section :"<<section<<endl;
    cout<<"Grade      :"<<grade<<endl;
    if(grade<75){
        cout<<"Student Have Failed"<<endl;
    }
    else {
        cout<<"Student Have Passed"<<endl;
    }
return 0;
}

Accept a String in C++

A simple code snippet to accept a string in C++.

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


accept.cpp

#include<iostream>
#include<string>

using namespace std;

int main()
{
    string mystring;
    cout<<"What is my name?";
    cin>>mystring;
    cout<<"My name is "<<mystring;

return 0;
}




Seconds to Hours,Minutes and Seconds Using Pointers Using Go

Create and design a program that will ask the user to give the number in seconds and then the program will convert its hours, minutes and seconds equivalent and display the result on the screen using pointers.

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

/* time_pointers.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 8, 2019  Thursday  4:14 PM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */


package main

import "fmt"

func main(){

var time,hours int32
var minutes,seconds int32

fmt.Print("\n");
fmt.Print("\tSeconds to Hours,Minutes and Seconds Using Pointers");
fmt.Print("\n\n");
fmt.Print("\tHow Many Days Worked? : ");
fmt.Scanln(&time);

check_time := &time

/* Conversion starts here */

hours = *check_time / 3600;
minutes = (*check_time % 3600) / 60;
seconds = ((*check_time % 3600) % 60);

fmt.Print("\n\n");
fmt.Print("\t===== DISPLAY RESULTS =====");
fmt.Print("\n\n");
fmt.Print("\tHour(s)   : ");
fmt.Printf("%d",hours);
fmt.Print("\n");
fmt.Print("\tMinute(s) : ");
fmt.Printf("%d",minutes);
fmt.Print("\n");
fmt.Print("\tSecond(s) : ");
fmt.Printf("%d",seconds);
fmt.Print("\n\n");
fmt.Print("\tEnd of Program");
fmt.Print("\n");
}