Posts

Showing posts from June, 2017

Arithmetic, Smallest and Largest

Image
We will be writing an application that  inputs three integers from the user and displays the sum, average, product, smallest and largest of the numbers using a java application GUI (Graphics User Interface) So the first step of the program will be to import javax.swing.JOptionPane which is part of the java packages and which has the capability of displaying and inputting text in dialog box. usually when inputting digits in java applications, it is entered as strings which can then be converted to corresponding data types like integers and floating point numbers. The program code below illustrates how to do a simple arithmetic, smallest and largest of three numbers. import javax.swing. JOptionPane ; public class Arithmetic {   public static void main( String args [])   {     String firstNumber;     String secondNumber;     String thirdNumber;     String compare;       int number1; ...