\u041d\u043e\u0432\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 - package exercise14 import [email protected] park public class Exercise14 cfw private static String ASK_NUMBER

u041du043eu0432u044bu0439...

This preview shows page 1 - 3 out of 3 pages.

/****/packageexercise14;importjava.util.Scanner;/*** @authorpark**/publicclassExercise14 {privatestaticString ASK_NUMBER= "Input a real number between 0 and 100 : ";floatmyNumber;/*** @paramargs not used*/publicstaticvoidmain(String[] args) {//create an input stream from keyboardScanner keyboard = newScanner(System.in);//prime the programSystem.out.println(ASK_NUMBER);try{String text = keyboard.next().trim();System.out.println("Debug: You just entered: "+text);floatmyNumber = Float.parseFloat(text);System.out.println(myNumber);} catch(Exception e) {System.out.println("Error: "+e.getMessage());}}}import javax.swing.*;import java.awt.*;public class Calculator {public static void main(String[] args) {JFrame myFrame = new JFrame("Калькулятор");JPanel myPanel = new JPanel();JPanel buttonPanel = new JPanel();JTextField screenTextField = new JTextField(50);BorderLayout myBorderLayout =new BorderLayout();GridLayout myGridLayout = new GridLayout(4,4);JButton button1 = new JButton("1");
JButton button2 = new JButton("2");JButton button3 = new JButton("3");JButton button4 = new JButton("4");

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture