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");

   }

   
   

}

 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");

   }

}

Leave a Reply

Your email address will not be published.