Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 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 computationtest;
- import javax.swing.*;
- /**
- *
- * @author Acer01
- */
- public class ComputationTest {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- String date[] = new String[10];
- String debbit[] = new String[10];
- int amount1[] = new int[10];
- String credit[] = new String[10];
- int amount2[] = new int[10];
- String ans, save = null, ask, yes = null;
- Integer integerAmount1, integerAmount2;
- int c = 0;
- do{
- date[c] = JOptionPane.showInputDialog("enter date: ");
- debbit[c] = JOptionPane.showInputDialog("debbit name: ");
- amount1[c] = Integer.parseInt(JOptionPane.showInputDialog("amount1: "));
- credit[c] = JOptionPane.showInputDialog("credit name: ");
- amount2[c] = Integer.parseInt(JOptionPane.showInputDialog("amount2: "));
- c++;
- ans = JOptionPane.showInputDialog("enter new? Yes/No");
- }while(ans.equalsIgnoreCase("yes"));
- ask = JOptionPane.showInputDialog("enter number: ");
- for(c = 0; c < date.length; c++){
- save = date[c];
- if(ask.equals(save)){
- JOptionPane.showMessageDialog(null, "Date: " + date[c] +
- "\n debbit: " + debbit[c] +
- "\n amount: " + amount1[c] +
- "\n : credit: " + credit[c] +
- "\n amount: " + amount2[c]);
- c++;
- }
- }
- ans = JOptionPane.showInputDialog("do you want to compute?");
- if(ans.equalsIgnoreCase("yes"))
- {
- ans.equalsIgnoreCase("yes");
- }
- else if(ans != yes)
- {
- JOptionPane.showMessageDialog(null, "Okay");
- }
- ask = JOptionPane.showInputDialog("enter name you want to compute: ");
- save = debbit[c];
- save = credit[c];
- if(ask.equals(save)){
- JOptionPane.showMessageDialog(null," total: " + (amount1[c] + amount2[c]));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement