Wednesday, October 27, 2021

Power of a Number in Java

Power a Number in Java

 Machine Problem

Write a Java program that will ask the user to give base and exponent number and then the program will compute the power of the number.

  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.




Program Listing

package test;



import java.util.Scanner;


/*

 * Power_A_Number.java

 * 

 * Jake Rodriguez 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 will ask the user to give base and exponent number

 * and then the program will compute the power of the number.

 * 

 */


public class Power_A_Number {


public static void main(String args[]){


   Scanner input = new Scanner(System.in);

      

      

      System.out.println();

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

      System.out.println();

      System.out.print("\tGive base number : ");

      int base = input.nextInt();

      int temp = base;

      System.out.print("\tGive exponent number : ");

      int exp = input.nextInt();


      for (int i=1; i<exp; i++){

         temp = temp*temp;

      }

      System.out.println();

      System.out.println("\tThe Result is "+base+" power "+exp+" is "+temp);

      System.out.println();

      System.out.print("\tEnd of Program \n");  

      System.out.println();

      input.close();

   }

}

Print 1 to 30 Using For Loop in C

Print 1 To 30 Using For Loop in C

 A simple program that I wrote using C programming language that will print 1 to 30 using for loop statement.

  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.





Program Listing

#include <stdio.h>



int main()

{

    int counter=0;

    int a=0;

    printf("\n\n");

    printf("\t  Print 1 To 30 Using For Loop in C");

    printf("\n\n\n");

    printf("\t");

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


          counter++;


         printf("%4d",a);


        


         if(counter == 10){


             


         printf("\n\t");


          counter = 0;


      }

       

     }

  printf("\n\n");

    printf("\t\t\tEnd of Program");

    printf("\n");

}


Tuesday, October 26, 2021

Simple Password in Java

Simple Password in Java

 A simple password program that I wrote 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.






Program Listing

package test; /* * Prof. Jake Rodriguez Pomperada, MAED-IT, MIT * www.jakerpomperada.com and www.jakerpomperada.blogspot.com * jakerpomperada@gmail.com * Bacolod City, Negros Occidental Philippines */ import java.util.Scanner; public class Password { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner(System.in); System.out.println(); System.out.println("\tSimple Password in Java"); System.out.println(); System. out. print("\tEnter your password : "); String password1 = input.nextLine(); System.out.println("\n"); if(password1.equals("SECRET")) { System. out. println("\tPassword is Granted"); }//end if else { System. out. println("\tPassword is denied"); } //end else System.out.println("\n"); System.out.print("\tEnd of Program \n"); System.out.println(); input.close(); } }


Monday, October 25, 2021

Addition and Product of Two Numbers in Python

Addition and Product of Two Numbers in Python

 A simple program to ask the user to give two numbers and then it will compute the sum, and product of two 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 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.






Program Listing

print()
print("\tAddition and Product of Two Numbers in Python")
print()
num1 = int(input('Enter first number: '))
num2 = int(input('Enter second number: '))

sum = (num1 + num2)
product = (num1 * num2)

print()
print('The sum of {0} and {1} is {2}.'.format(num1, num2, sum))
print()
print('The product of {0} and {1} is {2}.'.format(num1, num2, product))

Sunday, October 24, 2021

Addition and Product of Two Numbers in Java

Addition and Product of Two Numbers in Java

 A simple program that I wrote to ask the user to give two numbers, and then our program will compute the sum, and product of two 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 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.





Program Listing

package test; /* * Prof. Jake Rodriguez Pomperada, MAED-IT, MIT * www.jakerpomperada.com and www.jakerpomperada.blogspot.com * jakerpomperada@gmail.com * Bacolod City, Negros Occidental Philippines */ import java.util.Scanner; public class Addition_Product { public static void main(String[] args) { // TODO Auto-generated method stub int first=0, second=0; Scanner input = new Scanner(System.in); System.out.println(); System.out.println("\tAddition and Product of Two Numbers in Java"); System.out.println(); System.out.print("\tEnter First Number : "); first = input.nextInt(); System.out.print("\tEnter Second Number : "); second = input.nextInt(); int add = first + second; int product = first * second; System.out.println(); System.out.println("\tThe Sum of " + first + ", and " + second + " is " + add + "."); System.out.println(); System.out.println("\tThe Product of " + first + ", and " + second + " is " + product+ "."); System.out.println("\n"); System.out.print("\tEnd of Program \n"); System.out.println(); input.close(); } }

Saturday, October 23, 2021

Addition and Subtraction of Two Numbers in Java

Addition and Subtraction of Two Numbers in Java

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





Program Listing

package test;


/*

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

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

 * jakerpomperada@gmail.com

 * Bacolod City, Negros Occidental Philippines

 */


import java.util.Scanner;


public class Addition_Subtraction {


public static void main(String[] args) {

// TODO Auto-generated method stub

  int first=0, second=0;

Scanner input = new Scanner(System.in);

  

System.out.println();

    System.out.println("\tAddition and Subtraction of Two Numbers in Java");

    System.out.println();

    

    System.out.print("\tEnter First Numbers : ");

    first = input.nextInt();

    

    System.out.print("\tEnter Two Numbers : ");

    second = input.nextInt();


    int  add = first + second;

    int  subtract = first - second;

    

    if (first > second) {

   

    subtract = first - second;

    } else if (second > first) {

   

    subtract = second - first;

    } else if (first == second) {

    subtract = first - second;

     }

    System.out.println();

    System.out.println("\tThe Sum of " + first + " and " + second + " is " + add + ".");

    System.out.println();

    System.out.println("\tThe Difference Between " + first + " and " + second + " is " + subtract + ".");

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

    System.out.print("\tEnd of Program \n");  

    System.out.println();

    input.close();


}


}



Print 1 To 10 Using For Loop in Python

Print 1 To 10 Using For Loop in Python

 Machine Problem

 Write a Python program to print numbers from 1 to 10 using a for loop.

  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.





Program Listing

# print_1_To_10.py
# Prof. Jake Rodriguez Pomperada, MAED-IT, MIT
# www.jakerpomperada.blogspot.com and www.jakerpomperada.com
# jakerpomperada@gmail.com
#
# Machine Problem
# Write a Python program to print numbers from 1 to 10 using a for loop.

print()
print("\tPrint 1 To 10 Using For Loop in Python")
print()
for a in range(1, 11):
print("\t",a, end=' ')
print("\n")
print("\tEnd of Program")
print()

Friday, October 22, 2021

Print 1 To 100 Using For Loop in Java

Print 1 to 100 Using For Loop in Java

 A simple program that I wrote using Java programming to display numbers from 1 to  100 using for loop statement.

  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.






Program Listing

package test;

public class Print_1_T_100 {

public static void main(String[] args) {
// TODO Auto-generated method stub
        int counter=0;
  System.out.println("\n");
      System.out.println("\tPrint 1 To 100 Using For Loop in Java");
      System.out.println();
      System.out.print("\t");
      for (int a=1; a<=100; a+=1) {

          counter++;

         System.out.print("" + a +" ,");

        

         if(counter == 25){

             

          System.out.print("\n\t");

          counter = 0;

      }

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

}

Test Score Grade Equivalent in Java

Test Score Grade Equivalent in Java

 Machine Problem

 Write a program that will ask the user to give test score,   and then the program will convert the given test score into  grade numerical equivalent, 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.





Program Listing

package test;

/* grade.java

 * 

 * Prof. Jake Rodriguez 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 that will ask the user to give test score, 

 * and then the program will convert the given test score into

 * grade numerical equivalent, display the results on the screen.

 * 

 */

import java.util.Scanner;


public class grade {

   public static void main(String[] args)

   {

      double  score;    // To hold a test score

      double grade;    


      // Create a Scanner object to read input.

      Scanner console = new Scanner(System.in);


      

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

      System.out.println("\tTest Score Grade Equivalent in Java");

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

      // Get the test score.

      System.out.print("\tEnter your numeric test score : ");

      score = console.nextDouble();


      // Calculate the grade.

 if (score >=98)

      {

         grade = 1.00;

      }

      else if (score >=95)

      {

         grade = 1.25;

      }

      else if (score >=94)

      {

         grade = 1.50;

      }

      else if (score >= 90)

      {

         grade = 1.75;

      }

      else if(score>=87)

      {

         grade = 2.00;

      }

      else if(score>=84)

      {

         grade =2.25;

      }

      else if(score>=81)

      {

         grade = 2.50;

      }

      else if(score>=76 &&  score <= 78)

      {

          grade =2.75;

      }

      else 

      {

           grade =3.00;

      }

      // Display the grade.

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

      System.out.println("\tYour grade is " + grade);

      console.close();

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

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

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

   }

 }