Thursday, September 9, 2021

Three Dimensional Array in C++

 A simple program to demonstrate how to declare and use three dimensional arrays in 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 at 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 I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.





Program Listing

#include <iostream>

#include <vector>

#include <cassert>


template<class T>

class Array3D

{

  std::vector<T> data;

  size_t m_dim1, m_dim2, m_dim3;

public:

  Array3D(size_t dim1, size_t dim2, size_t dim3):

    m_dim1(dim1), m_dim2(dim2), m_dim3(dim3)

  {

    assert(m_dim1 > 1 && m_dim2 > 1 && m_dim3 > 1);

    data.resize(m_dim1 * m_dim2 * m_dim3);

  }

  T& operator()(size_t d1, size_t d2, size_t d3)

  {

    assert(d1 < m_dim1 && d2 < m_dim2 && d3 < m_dim3);

    return data[d1*d2*m_dim3 + d2*m_dim3 + d3];

  }

  const T& operator()(size_t d1, size_t d2, size_t d3) const

  {

    assert(d1 < m_dim1 && d2 < m_dim2 && d3 < m_dim3);

    return data[d1*d2*m_dim3 + d2*m_dim3 + d3];

  }

  size_t dim1() {return m_dim1;}

  size_t dim2() {return m_dim2;}

  size_t dim3() {return m_dim3;}

};


int main()

{

  Array3D<int> array3d(2,2,2);


  for ( size_t d1=0; d1 < 2; ++d1 )

  {

    for ( size_t d2=0; d2 < 2; ++d2 )

    {

      for ( size_t d3=0; d3 < 2; ++d3 )

      {

        array3d(d1,d2,d3) = 3;

      }

    }

  }


  array3d(1,1,1) = -99;


  std::cout << "Three Dimensional Arrays in C++";

  std::cout << "\n\n";

  for ( size_t d1=0; d1 < 2; ++d1 )

  {

    for ( size_t d2=0; d2 < 2; ++d2 )

    {

      for ( size_t d3=0; d3 < 2; ++d3 )

        std::cout << "array3d["<< d1 << "][" << d2 << "][" << d3 << "] = " << array3d(d1, d2, d3) << "\n";

    }

  }

}

Wednesday, September 8, 2021

Person's Age Checker in C

PERSONS AGE CHECKER IN C

A simple program to check the age of the person whether the person is already an adult or still a minor 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 at 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 I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.




 

Program Listing

/* Persons Age Checker in C */

/* Author  : Mr. Jake R. Pomperada, MAED-IT   */

/* Date    : March 1, 2017  Wednesday         */

/* Tools   : CodeBlocks 16.1                  */

/* Country : Philippines                      */



#include <stdio.h>


int age = 0;


int main()

{

    printf("\n\n");

    printf("\t===== PERSONS AGE CHECKER IN C =====");

    printf("\n\n");

    printf("\tWhat is your age : ");

    scanf("%d",&age);


    if (age >= 18 ) {

        printf("\n\n");

        printf("\tAt the age of %d years old you are already an ADULT.",age);

      }


    else {

        printf("\n\n");

        printf("\tAt the age of %d years old you are still a MINOR.",age);

      }

    printf("\n\n");

    printf("\tEND OF PROGRAM");

    printf("\n\n");

}



How To Run a Java Program Using BlueJ

Tuesday, September 7, 2021

Average Grade Solver in Java Using BlueJ

Average Grade Solver in Java Using BlueJ

  Machine Problem

Create a simple average solver of your grades. Then identify the grades whether pass or fail.

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 at 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 I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.







Program Listing

/* Average_Grade,java

 * Author : Jake Rodriguez Pomperada, MAED-IT, MIT

 * September 7, 2021   Tuesday   6:01 AM

 * www.jakerpomperada.blogspot.com  and www.jakerpomperada.com

 * jakerpomperada@gmail.com

 * Bacolod City, Negros Occidental Philippines.

 * 

 * Machine Problem

 * 

 * Create a simple average solver of your grades. Then identify the grades

 * whether pass or fail.

 */

import java.util.Scanner;

import java.math.RoundingMode;

import java.text.DecimalFormat;

 

public class Average_Grade {

    

     private static DecimalFormat df2 = new DecimalFormat("#.##");

     

 public static void main(String[] args) {

     

      Scanner input = new Scanner(System.in);

    

   System.out.print("Enter Subject: ");

  String subject = input.nextLine();

   

  System.out.print("Enter Prelim Grade: ");

  double prelim = input.nextDouble();

   

  System.out.print("Enter Midterm Grade: ");

  double midterm = input.nextDouble();

   

  System.out.print("Enter Final Grade: ");

  double final_grade = input.nextDouble();

   

  double average_grade = (prelim+midterm+final_grade)/3;

    

  if (average_grade >= 75) {

         

       System.out.println();

       df2.setRoundingMode(RoundingMode.DOWN);

       System.out.println("Your Final Grade is " + df2.format(average_grade) + "\n");

       System.out.print("You were successful in your " + subject + " class.");

  } else {

       System.out.println();

       df2.setRoundingMode(RoundingMode.DOWN);

       System.out.println("Your Final Grade is " + df2.format(average_grade) + "\n");

       System.out.print("You failed the " + subject + " subject.");

  }

  

 }

}




Sunday, September 5, 2021

Union Sample Program in C

Union Sample Program in C

 A simple program to demonstrate how to declare and use union in C programming language.

 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 at 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 I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.





Program Listing

/* unio.c
   Author : Professor Jake Rodriguez Pomperada, MAED-IT, MIT
   www.jakerpomperada.blogspot.com  and  www.jakerpomperada.com 
   jakerpomperada@gmail.com
   Bacolod City, Negros Occidental Philippines.
*/

#include <stdio.h>

union student
{
   char name[200],subject[200];
   int age;
   float grade;
};

int main()
{
 union student records;
 printf("\n\n");
 printf("\tUnion Sample Program in C");
 printf("\n\n");
 printf("\t===== DISPLAY RECORD =====");
 printf("\n\n");
 strcpy(records.name,"Jacob Samuel F. Pomperada");
 printf("\tStudent Name    :  %s\n ",records.name);
 records.age = 17;
 printf("\tStudent Age     :  %d\n ",records.age);
 strcpy(records.subject,"Linear Algebra");
 printf("\tStudent Subject :  %s\n ",records.subject);
 records.grade =89.03;
 printf("\tStudent Grade   :  %.2f\n ",records.grade);
 printf("\n");
 printf("\tEnd of Program");
 printf("\n\n");
}

Saturday, September 4, 2021

Student Grade Solver in AngularJS

Student Grade Solver in AngularJS

 Machine Problem

Write a program that will ask user to give the student name, subject, prelim grade, midterm grade, and end term grade. The program will display the student name, subject and compute the final grade of the student in the particular subject.

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 at 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 I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.





Program Listing

<!-- index.htm

  Author   : Prof. Jake Rodriguez Pomperada, MAED-IT, MIT

  Date     : July 24, 2021  Saturday 2:14 PM

  Place    : Bacolod City, Negros Occidental

  Websites : www.jakerpomperada.com and www.jakerpomperada.blogspot.com

  Email    : jakerpomperada@gmail.com

 -->

<html>

  <head>

    <title>Student Grade Solver in AngularJS</title>

  <script type="text/javascript" src="angular.min.js"></script>

     <script>

    var myApp=angular.module("myModule",[]);

    myApp.controller("Compute_Grade",function($scope) {

    $scope.SolveGrade=function()

    {

           

         compute_grade =  ($scope.prelim * 0.20) +  

                           ($scope.midterm * 0.30) +

                           ($scope.endterm * 0.50);


        $scope.title="===== Student Grade Report =====";

         $scope.student = "Student Name  : " + $scope.student_name;

         $scope.subject = "Subject       : " + $scope.subject_name; 

         $scope.final_grade =   "Final Grade   : " + compute_grade.toFixed(0);

       }



    });

     </script>

     

 </head>

 <style>

body {

font-family: arial;

font-size: 25px;

font-weight: bold;

}

</style>

 <body ng-app="myModule" ng-controller="Compute_Grade">

  <h3>Student Grade Solver in AngularJS</h3>

 <div>

  <table border="0">

  <tr>

  <td>

  Enter Student Name  </td>

       <td>

        &nbsp;&nbsp;&nbsp;&nbsp;

         <input type="text"  size="40" ng-model="student_name" required/>

       </td>

      <tr>

  <td>

  Enter Subject Name </td>

       <td>

        &nbsp;&nbsp;&nbsp;&nbsp;

         <input type="text" size="40" ng-model="subject_name" 

         required/>

       </td>   

       </tr>

       <tr>

         <td>&nbsp;&nbsp;&nbsp;</td>

        </tr>

       <tr>

       <td>

      Enter Prelim Grade </td>

       <td>

        &nbsp;&nbsp;&nbsp;&nbsp;

         <input type="number" ng-model="prelim"/>

       </td>   

       </tr>

       <tr>

       <td>

      Enter Midterm Grade </td>

       <td>

        &nbsp;&nbsp;&nbsp;&nbsp;

         <input type="number" ng-model="midterm"/>

       </td>   

       </tr>

       <tr>

       <td>

      Enter Endterm Grade </td>

       <td>

        &nbsp;&nbsp;&nbsp;&nbsp;

         <input type="number" ng-model="endterm"/>

       </td>   

       </tr>

       <tr>

         <td>&nbsp;&nbsp;&nbsp;</td>

        </tr>

      <tr>

      <td colspan="5">

      <input type="button" ng-click="SolveGrade()"

          title="Click here to solve the student grade."

      value="Solve Student Grade"/>

      </td>

      </tr>

      </table>

      <br>

       {{ title }} <br><br>

       {{ student | uppercase }} <br>

       {{ subject | uppercase }} <br><br>

       {{ final_grade }} 

     </div><br>

       </div>

    </body>

</html>

Thursday, September 2, 2021

Subtract Two Numbers Using a Functions in C

Substract Two Numbers Using Function in C

  A simple program to ask the user to give two numbers and then the program will subtract the difference of two numbers using functions in 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 at 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 I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.




Program Listing

/* subtract.c

 Prof. Jake Rodriguez Pomperada, MAED-IT, MIT

 www.jakerpomperada.com and www.jakerpomperada.blogspot.com

 jakerpomperada@gmail.com

 Bacolod City, Negros Occidental Philippines */


#include <stdio.h>


int substract(int a, int b)

{

int diff=0;

if (a>b) {

diff = a-b;

} else{

diff = b-a;

}

return(diff);

}


int main() {

int x=0,y=0;

printf("\n\n");

printf("\tSubstract Two Numbers Using A Function in C");

    printf("\n\n");

printf("\tEnter Two Numbers : ");

scanf("%d%d",&x,&y);

    printf("\n\n");

    printf("\tThe difference between %d and %d is %d.",

x,y,substract(x,y));

printf("\n\n");

printf("\tEnd of Program");

printf("\n\n");


}



Subtract Two Numbers Using Functions in C++

Substract Two Numbers Using Function in C++

 A simple program to ask the user to give two numbers and then the program will subtract the difference of two numbers using functions in 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 at 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 I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.





Program Listing

// subtract.cpp

// Prof. Jake Rodriguez Pomperada, MAED-IT, MIT

// www.jakerpomperada.com and www.jakerpomperada.blogspot.com

// jakerpomperada@gmail.com

// Bacolod City, Negros Occidental Philippines


#include <iostream>


using namespace std;


int substract(int a, int b)

{

int diff=0;

if (a>b) {

diff = a-b;

} else{

diff = b-a;

}

return(diff);

}


int main() {

int x=0,y=0;

cout <<"\n\n";

cout <<"\tSubstract Two Numbers Using Function in C++";

cout <<"\n\n";

cout << "\tEnter Two Numbers : ";

cin >> x >> y;

cout << "\n\n";

cout <<"\tThe difference between " << x

     << " and " << y << " is " <<

    substract(x,y) << ".";

cout << "\n\n";

cout << "\tEnd of Program";

cout << "\n\n";


}

Wednesday, September 1, 2021

Remove Vowels and Consonants in C

Remove Consonants and Vowels in C

 A simple program that I wrote to ask the user to give a string and then the program will remove the consonants and vowels in 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 at 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 I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.





Program Listing

/* consonants_vowels.c

   Author : Jake Rodriguez Pomperada, MAED-IT, MIT

   www.jakerpomperada.blogspot.com and www.jakerpomperada.com

   jakerpomperada@gmail.com

   Bacolod City, Negros Occidental Philippines

*/


#include <stdio.h>

#include <string.h>

#include <stdbool.h>


bool is_consonant(char ch)

{

  const char consonants[] = "bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ";


  return strchr(consonants, ch) != NULL;

}


bool is_vowel(char ch)

{

  const char vowels[] = "aeiouAEIOU";


  return strchr(vowels, ch);

}


char* remove_vowels(const char input[], char output[], size_t size)

{

int j = 0;

for(size_t i = 0; i < size; ++i)

if (!is_vowel(input[i]))

{

output[j++] = input[i];

}

output[j] = '\0';


return output;

}


char* remove_consonants(const char input[], char output[], size_t size)

{

int j = 0;

for(size_t i = 0; i < size; ++i)

if (!is_consonant(input[i])) {

output[j++] = input[i];

}

output[j] = '\0';


return output;

}


int main()

{

   char input[100] = "";

   char output[100] = "";


   printf("\n\n");

   printf("\tRemove Consonants and Vowels in C");

   printf("\n\n");

   printf("\tEnter a string: ");

   scanf("%99[^\n]s", input);


   printf("\n\n");

   printf("\tString Without Consonants: %s\n",remove_consonants(input, output, 100));

   printf("\n");

   printf("\tString Without Vowels    : %s\n",remove_vowels(input, output, 100));

   printf("\n\n");

   printf("\tEnd of Program");

   printf("\n\n");


}