Wednesday, December 15, 2021

Break Statement in C Programming Language

Break Statement in C

 A simple program to demonstrate how to declare and use the break statement 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.





Program Listing

/*break.c Author : Mr. Jake R. Pomperada,BSCS,MAED-IT Date : November 23, 2018 Tuesday 11:48 AM Location : Bacolod City, Negros Occidental Website : http://www.jakerpomperada.com Emails : jakerpomperada@jakerpomperada.com jakerpomperada@gmail.com jakerpomperada@yahoo.com jakerpomperada@aol.com */ #include <stdio.h> int main() { int a=0; printf("\n\n"); printf("\tBreak Statement in C"); printf("\n\n"); for (a=1; a<=10; a++) { if (a==6) { break; } printf("\t%4d",a); } printf("\n\n"); printf("\tThank you for Using This Software."); printf("\n\n"); printf("\tEnd of Program"); printf("\n\n"); }

Tuesday, December 14, 2021

Average of Three Numbers in Python

Average of Three Numbers in Python

 

Machine Problem in Python

Write a program that will ask the user to give three numbers and then the program will compute the average of the three numbers using Python
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.






Program Listing

# Jake R. Pomperada, MAED-IT, MIT
# www.jakerpomperada.com and www.jakerpomperada.blogspot.com
# jakerpomperada@gmail.com
# Bacolod City, Negros Occidental Philippines

# Machine Problem in Python
#
# Write a program that will ask the user to give three numbers and then
# the program will compute the average of the three numbers using Python
# programming language.

print()
print("\tAverage of Three Numbers in Python")
print()
a = int (input("Enter the First Number: "))
b = int (input("Enter the Second number: "))
c = int (input("Enter the Third number: "))

average=(a+b+c)/3

print()
print("The average of three numbers is ", average)
print("\n\tEnd of Program")

Monday, December 13, 2021

Simple Multiplication Table Using Arrays in C++

Simple Multiplication Table Using Arrays in C++

 A simple multiplication table using 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 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.





Program Listing

#include <cstdlib> #include <iostream> #include <iomanip> using namespace std; int main(int argc, char *argv[]) { int values[10] = {1,2,3,4,5,6,7,8,9,10}; int values2[10] = {10,9,8,7,6,5,4,3,2,1}; cout << "\n\n"; cout << " ===== SIMPLE MULTIPLICATION TABLE USING ARRAYS IN C++ ====="; cout << "\n\n Created By: Mr. Jake R.Pomperada,MAED-IT"; cout << "\n\n"; for (int list=0; list <10 ; list++) { cout << "\n"; cout<< setw(2) << list[values] << " x " << setw(2) << list[values] << " = " << setw(2) << list[values] * list[values]; cout<< setw(10) << list[values] << " + " << setw(2) << list[values2] << " = " << setw(1) << (list[values] + list[values2]); } cout << "\n\n"; system("PAUSE"); return EXIT_SUCCESS; }

Sunday, December 12, 2021

Sum and Average of Two Numbers in C++

Sum and Average of Two Numbers in C++

 A simple program to ask the user to give two numbers and then the program will solve the sum and average of the two given numbers 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.






Program Listing

#include <iostream> // sum_average.cpp // Written By: Mr. Jake Rodriguez Pomperada, MAED-IT, MIT // www.jakerpomperada.com and www.jakerpomperada.blogspot.com // jakerpomperada@gmail.com // Bacolod City, Negros Occidental Philippines int main() { float val_one, val_two; float sum, average; std::cout <<"\n"; std::cout << "\tSum and Average of Two Numbers in C++\n\n"; std::cout << "\tEnter First Value : "; std::cin >> val_one; std::cout << "\tEnter Second Value : "; std::cin >> val_two; sum = (val_one + val_two); average = (sum/2); std::cout <<"\n"; std::cout << "\tThe sum is " << sum << ".\n"; std::cout << "\tThe average is " << average << ".\n"; std::cout <<"\n"; }

User Defined Function in C++

User Defined Function in C++

 A simple program to demonstrate how to write user defined function 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 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.




Program Listing


#include <iostream>


int addition(int a, int b)

{

    return(a+b);

}


int product(int a, int b)

{

    return(a*b);

}


int main()

{

    std::cout <<"\n";

    std::cout << "\tUser Defined Function in C++\n\n";

    std::cout << "\tAddition Function :  " <<addition(2,4) << "\n";

    std::cout <<"\n";

    std::cout << "\tProduct Function  :  " <<product(5,5) << "\n";

    std::cout <<"\n";

}


Sum of Numbers Using Inheritance in Java

Saturday, December 11, 2021

Sum of Numbers Using Inheritance in Java

 Machine Problem

Write a program that prompts the user to input a positive   integer and it will loop until -1 is given and give the total sum of the   given numbers using Java 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.





Program Listing

import java.util.Scanner;


/*

 * Machine Problem

 * 

 * Write a program that prompts the user to input a positive 

   integer and it will loop until -1 is given and give the total sum of the 

   given numbers.

 */


class Sum_All {


int sum=0,data=0;

Scanner input = new Scanner(System.in);

 

void input_values()  {

System.out.println("\n");

     System.out.print("\tSum of Numbers Using Inheritance in Java");

     System.out.println("\n");

System.out.print( "Enter Positive Integer (the program exits if the input is -1): ");

data = input.nextInt();

}

}


class Sentinel extends Sum_All {


void Process_Data() {

while (data != -1) {

sum += data;

System.out.print("Enter Positive Integer (the program exits if the input is -1): ");

data = input.nextInt();

}

    } 


    void display() {

    System.out.println();

    System.out.println("The sum is " + sum+ ".");

input.close();

    }


    

    

    public static void main(String args[]) {

   

        Sentinel obj = new Sentinel();

        obj.input_values();

        obj.Process_Data();

        obj.display();

    }

}


Average of Three Numbers Using Inheritance in Java

Average of Three Numbers Using Inheritance in Java

 A simple program to ask the user to give three numbers and then the program will compute the average of three numbers using Inheritance in Java 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.





Program Listing


import java.util.Scanner;


class A {


    int a, b, c, average;

    Scanner sc = new Scanner(System.in);


    void input() {

    System.out.println("\n");

    System.out.print("\tAverage of Three Numbers Using Inheritance in Java");

    System.out.println("\n");

        System.out.print("\tEnter three numbers:");

        a = sc.nextInt();

        b = sc.nextInt();

        c = sc.nextInt();

    }

}


class Main extends A {


    void Solve_Average() {

        average = (a + b + c)/3;

    }


    void display() {

        System.out.println();

        System.out.println("\tThe average is " + average + ".");

        System.out.println();

        System.out.println("\tEnd of Program");

        System.out.println();

    }


    public static void main(String args[]) {

        Main obj = new Main();

        obj.input();

        obj.Solve_Average();

        obj.display();

    }

}


Friday, December 10, 2021

Area of Rectangle in Python

Area of Rectangle in Python

 # Machine Problem in Python

#
# Write a program to find the area of a rectangle in Python.
# Using the following formula
# Area = Width * Height

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.





Program Listing


# Jake R. Pomperada, MAED-IT, MIT
# www.jakerpomperada.com and www.jakerpomperada.blogspot.com
# jakerpomperada@gmail.com
# Bacolod City, Negros Occidental Philippines

# Machine Problem in Python
#
# Write a program to find the area of a rectangle in Python.
# Using the following formula
# Area = Width * Height

print("\n")
print("\tArea of Rectangle in Python")
print("\n")
width = float(input('Give the Width of a Rectangle: '))
height = float(input('Give the Height of a Rectangle: '))

# calculate the area
Area = width * height

print("\n")
print("Area of a Rectangle is: %.2f" %Area)
print("\n\tEnd of Program")
print("\n")

Thursday, December 9, 2021

Swapping of Numbers Using Pointers in C++

SWAPPING OF NUMBERS USING POINTERS IN C++

 A simple program to ask the user to give two numbers and then the program will swap the arrangement of two numbers using pointers 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 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.





Program Listing

#include <iostream>

#include <string>


 using namespace std;


 int swap_value(int *a, int *b, int temp)

 {

  temp = *a;

  *a = *b;

  *b = temp;

 }


 main() {


     int a=0,b=0,temp=0;

      char reply = 'Y';


 for (; toupper(reply)== 'Y'; ) {


 cout << "\n\n";

 cout << "\t\t SWAPPING OF NUMBERS USING POINTERS IN C++";

 cout << "\n\n\t Created By: Mr. Jake R. Pomperada,MAED-IT";

 cout << "\n\n";

 cout << "Enter the first value  :=> ";

 cin >> a;

 cout << "Enter the second value :=> ";

 cin >> b;


 cout << "\nOrignal value of a : " << a <<".";

 cout << "\nOrignal value of b : " << b <<".";


 cout << "\n\n";


 swap_value(&a,&b,temp);

 cout << "After calling the function Reference/Pointer";

 cout << "\n\n";


 cout << "\nNew value of a : " << a <<".";

 cout << "\nNew value of b : " << b <<".";

 cout << "\n\n";

 cout << "Do You Want To Continue Y/N :=> ";

 cin >> reply;


 }

 if (toupper(reply) == 'N') {

     cout << "\nThank You For Using This Program.";


  }

 cout << "\n\n";

 system("PAUSE");

 }