Saturday, October 9, 2021

Sum of All Odd and Even Numbers in Java

 Machine Problem

Write a program using Java to ask the user to give a number  and then the program will sum all the odd and even numbers of the given number, and display the results on the screen.

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.




/*  Odd_Even.java

 * 

 *  Prof. Jake Roderiguez Pomperada, MAED-IT, MIT

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

 *  jakerpomperada@gmail.com

 *  Bacolod City, Negros Occidental Philippines

 * 

 * 

Machine Problem


Write a program using Java to ask the user to give a number 

and then the program will sum all the odd and even numbers of

the given number, and display the results on the screen.

 */




import java.util.Scanner;


  


class Odd_Even


{

   

    

   public static void main(String args[])


   {


        int a=0,num=0;  

        int odd_numbers_sum=0,even_numbers_sum=0;

      

       Scanner input = new Scanner(System.in);


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

       System.out.println("\tSum of All Odd and Even Numbers in Java");

       System.out.println();

      

       System.out.print("\tGive a Number : ");

       

       num=input.nextInt();


    for(a=1; a<=num; a++){  

        if(a%2==0) 

          even_numbers_sum=even_numbers_sum+a;

        else

         odd_numbers_sum=odd_numbers_sum+a;

        }

        

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

        System.out.println("\tSum of all odd numbers are: "+odd_numbers_sum);

        System.out.println("\tSum of all even numbers are: "+even_numbers_sum);

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

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

       System.out.println();

      

        

   }


   

   


}






/*  Odd_Even.java *  *  Prof. Jake Roderiguez Pomperada, MAED-IT, MIT *  www.jakerpomperada.com  and www.jakerpomperada.blogspot.com *  jakerpomperada@gmail.com *  Bacolod City, Negros Occidental Philippines *  * Machine Problem
Write a program using Java to ask the user to give a number and then the program will sum all the odd and even numbers ofthe given number, and display the results on the screen. */


import java.util.Scanner;
  
class Odd_Even
{          public static void main(String args[])
   {
        int a=0,num=0;          int odd_numbers_sum=0,even_numbers_sum=0;             Scanner input = new Scanner(System.in);
       System.out.println("\n");       System.out.println("\tSum of All Odd and Even Numbers in Java");       System.out.println();             System.out.print("\tGive a Number : ");              num=input.nextInt();
    for(a=1; a<=num; a++){          if(a%2==0)           even_numbers_sum=even_numbers_sum+a;        else         odd_numbers_sum=odd_numbers_sum+a;        }                System.out.println("\n");        System.out.println("\tSum of all odd numbers are: "+odd_numbers_sum);        System.out.println("\tSum of all even numbers are: "+even_numbers_sum);        System.out.println("\n");       System.out.println("\tEnd of Progam");       System.out.println();                 }
      
}

Friday, October 8, 2021

Largest of Three Numbers in Java

Largest of Three Numbers in Java

 Machine Problem

 Write a Java program that finds largest of three numbers and then prints it. If the entered numbers are unequal then "numbers are not distinct" is printed.

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.





Program Listing


/*

 * Largest_of_Three_Numbers.java

 * 

  Prof. Jake Roderiguez Pomperada, MAED-IT, MIT

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

  jakerpomperada@gmail.com

  Bacolod City, Negros Occidental Philippines

 * 

 * Machine Problem

 * 

 * Write a Java program that finds largest of three numbers

and then prints it. If the entered numbers are unequal then "numbers are

not distinct" is printed.

 */


import java.util.Scanner;




class Largest_of_Three_Numbers


{


   public static void main(String args[])


   {


      int x=0, y=0, z=0;

      

       Scanner input = new Scanner(System.in);

       

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

       System.out.println("\tLargest of Three Numbers in Java");

       System.out.println();


      System.out.println("Enter three integers ");


     x = input.nextInt();


      y = input.nextInt();


      z = input.nextInt();


 


      if ( x > y && x > z )


         System.out.println("First number is largest.");


      else if ( y > x && y > z )


         System.out.println("Second number is largest.");


      else if ( z > x && z > y )


         System.out.println("Third number is largest.");


      else   


         System.out.println("Entered numbers are not distinct.");

         

      System.out.println();

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

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


   }


}


Plus 10, 100, and 1000 Methods in Java

Plus 10, 100, and 1000 Methods in Java

 Machine Problem


Create a Java program that would ask an integer from the user. This should be performed by the main method. Construct three (3) methods named showNumberPlus10(), showNumberPlus100(), and  showNumberPlus1000(). Each  methods should perform the task its name implies. Called the methods after the user input to display three (3) outputs in separate lines.

Sample  Program Output


Enter an Integer : 20

20 plus 10 is 30.

20 plus 100 is 120.

20 plus 1000 is 1020.


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.





Program Listing



/*  plus10.java

 * 

 *  Prof. Jake Roderiguez Pomperada, MAED-IT, MIT

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

 *  jakerpomperada@gmail.com

 *  Bacolod City, Negros Occidental Philippines

 * 

 * 

Machine Problem


Create a Java program that would ask an integer from the user.

This should be performed by the main method. Construct

three (3) methods named showNumberPlus10(), showNumberPlus100(),

and  showNumberPlus1000(). Each  methods should perform the task

its name implies. Called the methods after the user input to display

three (3) outputs in separate lines.


Sample  Program Output


Enter an Integer : 20

20 plus 10 is 30.

20 plus 100 is 120.

20 plus 1000 is 1020.



 */




import java.util.Scanner;


  


class plus10


{

     public  static int showNumberPlus10(int a)

    {  

        

         System.out.println("\t" + a + " plus 10  is " + (a+10) + ".");

         return 0;

    }  

   

    public  static int showNumberPlus100(int a)

    {  

        

         System.out.println("\t" +  a + " plus 100  is " + (a+100) + ".");

         return 0;

    }  

    

    public  static int showNumberPlus1000(int a)

    {  

        

         System.out.println("\t" + a + " plus 1000  is " + (a+1000) + ".");

         return 0;

    } 

    

   public static void main(String args[])


   {


      int x=0;

      

       Scanner input = new Scanner(System.in);


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

       System.out.println("\tPlus 10, 100, and 1000 Methods in Java");

       System.out.println();

      

        System.out.println("\tEnter an integer: ");

    


      x = input.nextInt();

      

     showNumberPlus10(x);

     showNumberPlus100(x);

     showNumberPlus1000(x);

        

       System.out.println();

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

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


   }


   

   


}


Reverse a Number in Java

Reverse a Number in Java

 A simple program to ask the use to give a number and then the program will reverse the given number 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 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.





Program Listing

 

import java.util.Scanner;


public class Reverse_Number {

    

    public static void main (String [] args)

    {

        

        int number=0, reverse=0;

        

        Scanner input = new Scanner (System.in);

        

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

        System.out.println("\tReverse a Number in Java ");

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

      

        System.out.println("\tGive Number : ");

        number= input.nextInt();

        

        int given_number = number; 

        

        while(number != 0)   

        {    

        int remainder = number % 10;  

        reverse = reverse * 10 + remainder;  

        number = number/10;  

        }  

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

        System.out.println("\tThe given number is " + given_number);

        System.out.println("\tThe reverse of the given number is: " + reverse);  

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

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

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

    }

}


    

Thursday, October 7, 2021

Student Form Entry in Java

Student Form Entry in Java

 A simple program that demonstrate the use of scanner, strings, and integers 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 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.




Program Listing

 

import java.util.Scanner;


public class StudentInfo {

    

    public static void main (String [] args)

    {

        /*variables declaration */

        String name;

        String course;

        String gender;

        long studNum;

        int age=0;

        

        Scanner i = new Scanner (System.in);

        

        /*Form*/

        System.out.println("\tSTUDENT FORM ENTRY IN JAVA ");

        System.out.println("Enter Your Name: ");

        name= i.nextLine();

        System.out.println("Enter Your Course: ");

        course= i.nextLine();

        System.out.println("Enter Your Gender: ");

        gender= i.nextLine();

        System.out.println("Enter Your Student Number: ");

        studNum= i.nextInt();

        System.out.println("Enter Your Age: ");

        age= i.nextInt();

        

        /*Output*/

        System.out.println("Your name is: " +name);

        System.out.println("Your course is: " +course);

        System.out.println("Your gender is: " +gender);

        System.out.println("Your student number is: " +studNum);

        System.out.println("Your age is: " +age);

        

    }

}


    

Wednesday, October 6, 2021

Decimal, Whole Number, and Strings in C++

Decimal, Whole Numbers, and Strings in C++

  Machine Problem

   Write a program that would ask 2 decimal numbers,  2 whole numbers and 3 shapes.

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.




Program Listing

/* input.cpp

   Prof. Jake Rodriguez Pomperada, MAED-IT, MIT

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

   jakerpomperada@gmail.com

   Bacolod City, Negros Occidental

   

   Machine Problem

   

    Write a program that would ask 2 decimal numbers,

2 whole numbers and 3 shapes.

*/


#include <iostream>

#include <iomanip>

#include <string.h>


int main()

{

double a=0.00,b=0.00;

int c=0,d=0;

char shape1[100],shape2[100],shape3[100];

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

std::cout << "\tDecimal, Whole Numbers, and Strings in C++";

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

std::cout << "\tEnter Two Decimal Numbers : ";

std::cin >> a >> b;

std::cout << "\tEnter Two Integer Numbers : ";

std::cin >> c >> d;

  std::cin.ignore(256, '\n');

std::cout << "\tEnter First Shape : ";

gets(shape1);

std::cout << "\tEnter Second Shape : ";

gets(shape2);

std::cout << "\tEnter Third Shape : ";

gets(shape3);

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

std::cout <<"\tFirst Decimal Number  : " << a;

std::cout <<"\n";

std::cout << "\tSecond Decimal Number : " << b;

std::cout <<"\n";

std::cout << std::fixed << std::showpoint;

    std::cout << std::setprecision(2);

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

std::cout <<"\tFirst Integer Number  : " << c;

std::cout <<"\n";

std::cout <<"\tSecond Integer Number : " << d;

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

std::cout <<"\tFirst Shape           : " << shape1;

std::cout <<"\n";

std::cout <<"\tSecond Shape          : " << shape2;

std::cout <<"\n";

std::cout << "\tThird Shape           : " << shape3;

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

std::cout <<"\tEnd of Program";

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

}

Greet Yourself in AngularJS

Greet Yourself in AngularJS

 A simple program to ask the user to give name and then the program will greet the user using AngularJS.

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.





Program Listing

index.htm

<!-- index.htm

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

  Date     : October 3, 2021  Sunday  10:26 AM

  Place    : Bacolod City, Negros Occidental

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

  Email    : jakerpomperada@gmail.com

 -->

<html>

<head> 

<title> Greet yourself in AngularJS </title>

</head>

<style>

p {

   color:black;

   font-family: "arial";

   font-style: bold;

   font-size: 18px;

  }

  

h3{

   font-family: "arial";

   font-style: bold;

   font-size: 20px;

  }

  

 input[type='text'] 

   { 

   color:black;

   font-family: "arial";

   font-size: 18px;

   font-style: bold;

   }

 </style>

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

<body>

<br><br>

<h3>Greet Yourself in AngularJS </h3>

<div ng-app="">

    <p>Give Your Name &nbsp; &nbsp;&nbsp;<input type="text" size="50" ng-model="name"></p>

<p>Hello <b>{{ name | uppercase }}. </b></p>

</div>.

</body>

</html>