Sunday, October 17, 2021

Count Lower Case Letters in Java

Count Lower Case Letters in Java

 Machine Problem

Write a Java program to ask the user a string and then the program will count the number    of lowercase letters in the given string by user.

 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


/*

 *  LowerCase.java

 *  

 *  Jake Rodriguez Pomperada, MAED-IT, MIT

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

 *  jakerpomperada@gmail.com

 *  Bacolod City, Negros Occidental Philippines

 * 

 * Machine Problem

 * 

 * Write a Java program to ask the user a string and then the program will count the number

 * of lowercase letters in the given string by user.

 */


import java.util.Scanner;


 

public class LowerCase_Letters {

    

    

    private static long countLowerCase(String s) {

    return s.codePoints().filter(c-> c>='a' && c<='z').count();

}

    

 public static void main(String[] args) {

     

  Scanner input = new Scanner(System.in);

   

  System.out.println();

  System.out.println("\tCount Lower Case Letters in Java");

  System.out.println();

  

  System.out.print("\tEnter a String : ");

  String val_str = input.nextLine();

  

  long count_LowerCase = countLowerCase(val_str);

  

  System.out.println();

  System.out.print("\tNumber of Lowercase Letters : " + count_LowerCase);

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

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

  System.out.println();

 }

 

}


Count Capital Letters in Java

Count Capital Letters in Java

 Machine Problem

Write a Java program to ask the user a string and then the program will count the number  of capital letters in the given string by user.

 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


/*

 *  Capital_Letters.java

 *  

 *  Jake Rodriguez Pomperada, MAED-IT, MIT

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

 *  jakerpomperada@gmail.com

 *  Bacolod City, Negros Occidental Philippines

 * 

 * Machine Problem

 * 

 * Write a Java program to ask the user a string and then the program will count the number

 * of capital letters in the given string by user.

 */


import java.util.Scanner;


 

public class Capital_Letters {

    

    private static long countUpperCase(String s) {

    return s.codePoints().filter(c-> c>='A' && c<='Z').count();

}

    

 public static void main(String[] args) {

     

  Scanner input = new Scanner(System.in);

   

  System.out.println();

  System.out.println("\tCount Capital Letters in Java");

  System.out.println();

  

  System.out.print("\tEnter a String : ");

  String val_str = input.nextLine();

  

  long count_Capital = countUpperCase(val_str);

  

  System.out.println();

  System.out.print("\tNumber of Capital Letters : " + count_Capital);

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

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

  System.out.println();

 }

 

}


Saturday, October 16, 2021

Basic Math Program in AngularJS

Basic Math Program in AngularJS

 Machine Problem

Write a program that will ask the user to give two numbers and then the program will compute the sum, difference, product, and quotient of the two given numbers by the user and display the results on the screen 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.





Program Listing

<!-- index.htm

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

  Date     : July 24, 2021  Saturday 10:30 PM

  Place    : Bacolod City, Negros Occidental

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

  Email    : jakerpomperada@gmail.com

 -->

<html>

  <head>

    <title>Basic Math Program in AngularJS</title>

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

     

 </head>

 <style>

body {

font-family: arial;

font-size: 25px;

font-weight: bold;

}

</style>

 <body ng-app="">

  <h3>Basic Math Program in AngularJS</h3>

 <div>

  <table border="0">

  <tr>

  <td>

  Enter First Value </td>

       <td>

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

         <input type="number"  size="10" ng-model="val_1" required/>

       </td>

     </tr>

       <tr>

        <td>

      Enter Second Value </td>

       <td>

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

         <input type="number"  size="10" ng-model="val_2" required/>

       </td>

     </tr>

       <tr>

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

      </tr>

       </table>

       The sum of {{val_1}} and {{val_2}} is {{val_1+val_2}}.<br>

       The difference between {{val_1}} and {{val_2}} is {{val_1-val_2}}.<br>

       The product between {{val_1}} and {{val_2}} is {{val_1*val_2}}.<br>

       The quotient between {{val_1}} and {{val_2}} is {{(val_1/val_2) | number:0}}.<br>

       <br>

    </div><br>

       </div>

    </body>

</html>

Friday, October 15, 2021

Addition, Difference, Product and Quotient in Java

Addition, Difference, Product, and Quotient in Java

 Machine Problem

Write a Java program to print the addition, difference, multiply, divide of two numbers.

 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

/*

 *  Math.java

 *  

 *  Jake Rodriguez Pomperada, MAED-IT, MIT

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

 *  jakerpomperada@gmail.com

 *  Bacolod City, Negros Occidental Philippines

 * 

 * Machine Problem

 * 

 * Write a Java program to print the addition,difference, multiply, divide of two numbers.

 */


import java.util.Scanner;

import java.math.RoundingMode;

import java.text.DecimalFormat;

 

public class Math {

    

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

 

 public static void main(String[] args) {

     

  Scanner input = new Scanner(System.in);

   

  System.out.println();

  System.out.println("\tAddition, Difference, Product, and Quotient in Java");

  System.out.println();

  

  System.out.print("\tEnte First Number : ");

  double val_1 = input.nextDouble();

   

  System.out.print("\tEnter Second Number : ");

  double val_2 = input.nextDouble();

  

 System.out.println();

 System.out.println("\tThe sum between " + val_1 + " and " + val_2 + " is " + (val_1 + val_2) + "." );

 System.out.println("\tThe difference between " + val_1 + " and " + val_2 + " is " + df2.format((val_1 - val_2)) + "." );

 System.out.println("\tThe product between " + val_1 + " and " + val_2 + " is " + df2.format((val_1 * val_2)) + "." );

 System.out.println("\tThe quotient between " + val_1 + " and " + val_2 + " is " + df2.format((val_1 / val_2)) + "." ); 

 

  System.out.println();

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

  System.out.println();

 }

 

}

How To Check For Fake News?

Thursday, October 14, 2021

Rating of a Score in Java

Rating of a Score in Java

 Machine Problem

 Create a simple program that will determine the rating of a score

 Rating

46 - 50 -> Excellent

41-45 -> Outstanding

36-40 -> Very Satisfactory

31 - 35  -> Satisfactory

Other values -> Out of rating

 Output

Enter Score : 45

Your Score is 45 and equivalent rating is Outstanding.

 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

 // rating_score.java

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

  // October 14, 2021   6:32 PM  Thursday

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

  // jakerpomperada@gmail.com

  // Bacolod City, Negros Occidental Philippines.

 

 // Machine Problem

 // Create a simple program that will determine the rating of a score


 // Rating


// 46 - 50 -> Excellent


// 41-45 -> Outstanding


// 36-40 -> Very Satisfactory


// 31 - 35  -> Satisfactory


// Other values -> Out of rating


// Output


// Enter Score : 45


// Your Score is 45 and equivalent rating is Outstanding.

 

 import java.util.Scanner;

 

public class rating_score {

    

         

 public static void main(String[] args) {


     Scanner scan = new Scanner(System.in);


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

  System.out.print("\tRating of a Score in Java");

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

  System.out.print("\tEnter Score :");


  int score = scan.nextInt();

   

     System.out.println();


        if(score >= 46  && score <= 50){

            System.out.println("\tYour Score is " + score + " and equivalent rating is Excellent.");

        }else if (score >= 41  && score <= 45){

            System.out.println("\tYour Score is " + score + " and equivalent rating is OutStanding.");

        }else if (score >= 36 && score <= 40) {

            System.out.println("\tYour Score is " + score + " and equivalent rating is Very Satisfactory.");

        }else if (score >= 31 && score <= 35){

            System.out.println("\tYour Score is " + score + " and equivalent rating is Satisfactory.");

            

        }else {

            System.out.println("\tOut of Rating. Please Try Again.");

                 } 

  

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

   System.out.print("\tEND OF PROGRAM");

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

  

 }

}




Area and Circumference of a Circle in Java

Area, and Circumference of a Circle in Java

 Machine Problem

 Write a program  to ask the user to give the radius of a circle, then the program   will calculate, and display the area and circumference of the circle on the screen 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

// area_circumference_circle.java

// Jake Rodriguez Pomperada,MAED-IT, MIT

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

// jakerpomperada@gmail.com

// Bacolod City, Negros Occidental Philippines


/* 

 * Machine Problem

 * 

 * Write a program  to ask the user to give the radius of a circle, then the program

 * will calculate, and display the area and circumference of the circle on the screen.

 * 

 */


import java.util.Scanner;

import java.math.RoundingMode;

import java.text.DecimalFormat;



public class area_circumference_circle {

    

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


    public static void main(String[] args) {


        double radius=0.00;

        double area=0.00, circumference=0.00;

        

        Scanner scan = new Scanner(System.in);

        

              

        System.out.println();

        System.out.print("\tArea, and Circumference of a Circle in Java ");

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

                     

        System.out.print("\tGive the Radius of the Circle : ");

        radius = scan.nextDouble();

      

        area = (3.14*radius*radius);

        

        circumference = (2 * 3.14 * radius);

      

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

        System.out.print("\tThe Area of The Circle : " + df2.format(area));

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

        System.out.print("\tThe Circumference of The Circle : " + df2.format(circumference));

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

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

        System.out.println();

   }

}


Wednesday, October 13, 2021

Letter Grade in Java

Letter Grade in Java

 Create a program that will input grade and will display the corresponding  * equivalent. Use if statement in a program.

  GRADE           EQUIVALENT

  A               EXCELLENT

  B               VERY GOOD

  C               GOOD

  D               FAIR

  E               POOR

  F               NEEDS IMPROVEMENTS

 OTHER LETTERS   INVALID GRADE.

 Sample Program Output

 Enter a Grade : E

 E IS YOUR GRADE AND YOU ARE POOR.

 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

  

/* Letter_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.

 *

 */

       //packages to import

import java.util.Scanner;


class Letter_Grade


{

   

/*

 * Machine Problem

 * 

 * Create a program that will input grade and will display the corresponding

 * equivalent. Use if statement in a program.

 * 

 * GRADE           EQUIVALENT

 * A               EXCELLENT

 * B               VERY GOOD

 * C               GOOD

 * D               FAIR

 * E               POOR

 * F               NEEDS IMPROVEMENTS

 * OTHER LETTERS   INVALID GRADE.

 * 

 * Sample Program Output

 * 

 * Enter a Grade : E

 * E IS YOUR GRADE AND YOU ARE POOR.

 * 

 */

    

   public static void main(String args[])


   {


System.out.println("\tLetter Grade in Java");

System.out.println(); //print a blank line


//construct a scanner object

Scanner sc = new Scanner(System.in);


//perform conversions until choice is value other than "y" or "Y"

String choice = "y";

String letter_grade;

String remarks;

while (choice.equalsIgnoreCase("y"))

{

//get input from the user

System.out.print("\tEnter a Grade:\t");

letter_grade = sc.next();


//convert user letter grade into grade remarks

if (letter_grade.equalsIgnoreCase("a"))

   remarks = "EXCELLENT";

else if (letter_grade.equalsIgnoreCase("b"))

remarks = "VERY GOOD";

else if (letter_grade.equalsIgnoreCase("c"))

remarks = "GOOD";

else if (letter_grade.equalsIgnoreCase("d"))

remarks = "FAIR";

else if (letter_grade.equalsIgnoreCase("e"))

remarks = "POOR";

else if (letter_grade.equalsIgnoreCase("f"))

remarks = "NEED IMPROVEMENTS";

else

remarks = "INVALID GRADE.";

String upper_case_grade =letter_grade.toUpperCase();


// display conversion result

System.out.println();

String message =  "\t" + upper_case_grade + " IS YOUR GRADE AND YOU ARE " + remarks + ".";

System.out.println(message);


//see if user wants to continue

System.out.println();

System.out.print("\tContinue? (y/n):\t");

choice = sc.next();

System.out.println();

}//end while loop

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

       System.out.println();

             

   }

  

}  // End of Code


 

Sum, Difference, Product, and Quotient in C++