[20160704]Addition program that use JOptionPane for input and output

 1 //Addition program that use JOptionPane for input and output.
 2
 3 import javax.swing.JOptionPane;
 4
 5 public class Addition{
 6    public static void main(String[] args) {
 7      String firstNumber=JOptionPane.showInputDialog("Enter first integer!");
 8
 9      String secondNumber=JOptionPane.showInputDialog("Enter second integer!");
10
11      int num1=Integer.parseInt(firstNumber);
12      int num2=Integer.parseInt(secondNumber);
13
14      int sum=num1+num2;
15
16      JOptionPane.showMessageDialog(null,"The sum is:\t"+sum,"sum of two integers",JOptionPane.PLAIN_MESSAGE);
17
18    }
19 }
时间: 2024-08-05 06:40:06

[20160704]Addition program that use JOptionPane for input and output的相关文章

File Input and Output

Use of File Stream Assume ifle and ofile is the string object storing the names of input and output files' namess. string ifile = "inputFile.txt"; string ofile = "outputFile.txt"; Then the use of file stream is like this: // construct

标准库 - 输入输出处理(input and output facilities) lua

标准库 - 输入输出处理(input and output facilities)责任编辑:cynthia作者:来自ITPUB论坛 2008-02-18 文本Tag: Lua [IT168 技术文档]I/O库提供两种不同的方式进行文件处理1.io表调用方式:使用io表,io.open将返回指定文件的描述,并且所有的操作将围绕这个文件描述 io表同样提供三种预定义的文件描述io.stdin,io.stdout,io.stderr2.文件句柄直接调用方式,即使用file:XXX()函数方式进行操作,

转载:Pixhawk源码笔记四:学习RC Input and Output

转自:新浪@WalkAnt 第五部分 学习RC Input and Output 参考:http://dev.ardupilot.com/wiki/learning-ardupilot-rc-input-output/ RC Input,也就是遥控输入,用于控制飞行方向.改变飞行模式.控制摄像头等外围装置.ArduPilot支持集中不同RC input(取决于具体的硬件飞控板): 1. PPMSum – on PX4, Pixhawk, Linux and APM2 2. SBUS – on P

Python Tutorial 学习(七)--Input and Output

7. Input and Output Python里面有多种方式展示程序的输出.或是用便于人阅读的方式打印出来,或是存储到文件中以便将来使用.... 本章将对这些方法予以讨论. 两种将其他类型的值转换为字符型值的方法:repr()和str(),二者的区别在于,一个是给机器读的,一个是给人读的,str()返回的是更适合人阅读的样式 一些栗子: >>> s = 'Hello, world.' >>> str(s) 'Hello, world.' >>>

Input and Output Method

IO stands for input and output in programming. IO is important in programming, especially in Olympic Informatic, due to the policy of it. Therefore, as a contestant in Olympic Informatic, it's neccesary for me to sumarize the method of IO, in order t

angular 的 @Input、@Output 的一个用法

angular 使用 @input.@Output 来进行父子组件之间数据的传递. 如下: 父元素: <child-root parent_value="this is parent value" (child_emit)="test()"></child-root> 父元素标签中有一个属性是,parent_value,在子元素中可以使用该值: <p [title]="parent_value" >this p

input和output常用模块的讲解和使用(logstash)

1 ELK 是一个实时分布式的日志分析平台ELK 是一整套的解决方案(E)lasticsearch -- 数据库(L)ogstash -- 收集日志.标准化的程序(K)ibana -- 图形的展示工具 2 数据批量导入-X 导入使用的方法 POST--data-binary 导入数据的格式@urfile 导入数据的文件名_bulk 导入关键字curl -X "POST" "http://192.168.1.13:9200/_bulk" --data-binary @

spring cloud Stream input和output重名报错

目前项目是用的springboot 2.0.5.RELEASE,版本号为:Finchley.SR2客户端测试代码如下: import org.springframework.cloud.stream.annotation.Input; import org.springframework.cloud.stream.annotation.Output; import org.springframework.messaging.MessageChannel; import org.springfra

C lang:character input and output

Xx_Introduction Character input and output is by more line character conpose of the text flow  Define name common use capital  letter,easy read. The Standard C Library ----->provide I/O model ------>use character flow way. Ax_Application file copy,c