Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Java by brent ( 9 years ago )
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication1;
import java.util.Scanner;
/**
*
* @author Student
*/
public class JavaApplication1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
/** printask();
}
public static void printask()
{
System.out.println(" fsdlkjfldskf");
System.out.println("sajdlaksjdlk");
}
}
*/
float num4;
int num1,num2, num3;
Scanner sc =new Scanner(System.in);
printask();
System.out.println("enter 1st #: ");
num1=sc.nextInt();
System.out.println("enter 2nd #: ");
num2=sc.nextInt();
Getsum(num1,num2);
num3 = getdiff(num1,num2);
System.out.println("the difference is: " +num3);
num4 = getproduct();
System.out.println("the product is: " +num4);
printask();
}
public static void printask()
{
System.out.println("*********************...********************");
System.out.println("*********************...********************");
}
private static void Getsum(int a, int b) {
int sum = a + b;
System.out.println("the sum is: " +sum);
}
public static int getdiff(int a, int b) {
int diff = a - b;
return diff;
}
public static float getproduct(int a, int b) {
float x = (float) 5.5, y=(float) 10.10, z;
z= x * y;
return z;
}
private static float getproduct() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
Revise this Paste