Не знаю как сделать ...Учитель тоже не знает ( или учить не хочет ). Как можно их туда разумно и красиво поместить ?| Цитата | //Balance.java
//program for cash machine in local bank
import javax.swing.JOptionPane ; //import class JOptionPane
public class Balance
{ //main method begins execution of Java application
public static void main(String args[]) { String yourRequest_S; // number entered by user int yourRequest ; // amount of money to withdraw double deposit ; // deposit stored in bank double balance ; // account balance after withdraw String print_S ;// answer entered by user int print; //read in a String entered by user yourRequest_S=JOptionPane.showInputDialog("How much pounds you would like to withdraw ?"); //convert from type String to type int yourRequest=Integer.parseInt(yourRequest_S); deposit=200; if (yourRequest<=deposit) {JOptionPane.showMessageDialog(null,"Please wait..\n .......Take the money.","Results",JOptionPane.PLAIN_MESSAGE); balance=deposit-yourRequest; //read in answer as a String entered by user print_S=JOptionPane.showInputDialog(null,"Do want to print your balance ?\n\nPress__ONE__ if, Yes. I want to print.\n\nPress____TWO___if, No. Don't print.","Results",JOptionPane.PLAIN_MESSAGE); //convert from type String to type int print=Integer.parseInt(print_S); if (print==1) JOptionPane.showMessageDialog(null,"Your account balance is"+"\n "+balance+" "+"pounds","Results",JOptionPane.PLAIN_MESSAGE); } if (yourRequest>deposit) JOptionPane.showMessageDialog(null,"Not enought money "); System.exit(0); //terminate the Java application }//end method main }//end class Balance
|
|