Friday, October 15, 2021

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++

Tuesday, October 12, 2021

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

 Machine Problem

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

Enter 1st number:  100

Enter 2nd number: 10

Sum: 110

Difference: 90

Product: 1000

Quotient:  10

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.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>

#include <iomanip>


/*


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


Enter 1st number:

Enter 2nd number:


Sum:

Difference:

Product:

Quotient: */


int main()

{

  double a=0.00,b=0.00;

  double sum=0.00,difference=0.00;

  double product=0.00, quotient=0.00;


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

  std::cout << "\tSum, Difference, Product, and Quotient in C++";

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

  std::cout <<"\tEnter 1st Number : ";

  std::cin >> a;

  std::cout <<"\tEnter 2nd Number : ";

  std::cin >> b;

  std::cout <<"\n";


  sum = (a+b);

  difference = (a-b);

  product = (a * b);

  quotient = (a/b);


  std::cout <<"\n";

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

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

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

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

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

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

  std::cout <<"\n";

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

  std::cout <<"\n";

}



Parts of Computer & Software System

Count Digits in Python

Count Digits in Python

 In this program that I wrote will ask the user to give a string which contains a digits and then the program will count the number of digits in a giving string or sentence using Python programming language. I am using Pycharm as my text editor in writing this program. I hope you will learn something in this sample program.

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

# digits.py
# Jake Rodriguez Pomperada, MAED-IT, MIT
# jakerpomperada.com and jakerpomperada.blogspot.com
# jakerpomperada@gmail.com
# Bacolod City, Negros Occidental
print()
print("\tCount Digits in Python")
print()
val_str = input('Give a String : ')

count = 0
for char in val_str:
if char.isdigit():
count += 1
print()
print(f"Number of Digits: {count}")
print()
print("\tEnd of Program")
print()


Monday, October 11, 2021

Count Vowels in Python

Count Vowels in Python

 A simple program that will ask the user to give a string and then the program will count number of vowels in the given string by the user 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

# vowels.py
# Jake Rodriguez Pomperada, MAED-IT, MIT
# jakerpomperada.com and jakerpomperada.blogspot.com
# jakerpomperada@gmail.com
# Bacolod City, Negros Occidental
print()
print("\tCount Vowels in Python")
print()
val_str = input('Give a String : ')

vowels=0
for i in val_str:
if(i=='a' or i=='e' or i=='i' or i=='o' or i=='u' or i=='A' or i=='E' or i=='I' or i=='O' or i=='U'):
vowels=vowels+1
print()
print(f"Number of Vowels: {vowels}")
print()
print("\tEnd of Program")
print()

Sunday, October 10, 2021

ng app Directives in AngularJS

ng-app directive in AngularJS

 A simple program to show how to declare and use ng-app directive in 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     :  October 10, 2021  3:37 PM  Sunday

  Place    : Bacolod City, Negros Occidental

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

  Email    : jakerpomperada@gmail.com

 -->

<html>

<head> 

<title>ng-app directive in AngularJS</title>

</head>

<style>

body {

   font-family: "arial";

   font-style: bold;

   font-size: 18px;

  }

 </style>

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

<h3>ng-app directive in AngularJS</h3>

<body>

<div ng-app="">

{{'AngularJS Programming '}}

</div>

</body>

</html>


Hello World in TypeScript

Hello World in TypeScript

 A simple program that I demonstrate how create a hello world in TypeScript 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


// greet.ts

// Jake Rodriguez Pomperada, MAED-IT, MIT

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

// jakerpomperada@gmail.com


var greet: string = "Hello World !!! Welcome To TypeScript";

console.log('\n',greet);