avatar
问几个菜问题# Java - 爪哇娇娃
p*m
1
Question 1
Write a complete Java program that will prompt the user to enter two numbers
. The program should add together all the numbers from the first number to t
he second number.
Some details:
Input: Input two integer numbers via JOptionPane.
Forumula: Use the below formula to calculate the sum
sum = (n/2)*(2*a+(n-1)); where n is the number of terms to be added; a is th
e first number.
Output: Output the two numbers and the total of the sum using System.out.pri
ntln(). Also, output your nam
avatar
g*y
2
这也太家庭作业了吧?版上没人会回的。

【在 p******m 的大作中提到】
: Question 1
: Write a complete Java program that will prompt the user to enter two numbers
: . The program should add together all the numbers from the first number to t
: he second number.
: Some details:
: Input: Input two integer numbers via JOptionPane.
: Forumula: Use the below formula to calculate the sum
: sum = (n/2)*(2*a+(n-1)); where n is the number of terms to be added; a is th
: e first number.
: Output: Output the two numbers and the total of the sum using System.out.pri

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。