JAVA Sample Problem:
PROGRAM:
import javax.swing.*;public static void main (String arg[]){int sum, inputVal, rem1, rem2, val1, val2, val3, val4;inputVal = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter Value:"));val1 = inputVal/1000;rem1 = inputVal%1000;val2 = rem1/100;rem2 = rem1%100;val3 = rem2/10;val4 = rem2%10;sum = val1 + val2 + val3 + val4;System.out.println("You entered " + inputVal);System.out.println("The sum of your input is: " + sum);}
In this example, division and modulu is used to extract each digit from the number entered by the user. Netbeans IDE was used to program this sample problem. Here are some screenshots of the program:
Playtech Casinos & Games for Real Money at Jammy
ReplyDeleteJambia Casino: Playtech Casinos & Games for Real Money at Jammy 여수 출장샵 원주 출장마사지 — This site 안양 출장마사지 offers gambling machines, slot machines and live 메이피로출장마사지 dealer 경상북도 출장샵