帮助Java编程(使用JEdit) [英] Help With Programming in Java (Using JEdit)

查看:64
本文介绍了帮助Java编程(使用JEdit)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这是否是正确的问题,但我试图在java中创建一个小程序,可以计算一个正方形的面积,然后是多个正方形,如果用户输入正方形的数量和正方形的大小增量,即


//获取长度(长度)

System.out.print("正方形的长度: ?");

L = data_input.nextDouble();


//获取要计算的平方区域数(N)

System.out.print(你想要计算多少个正方形:?);

N = data_input.nextDouble();


//获得方形大小增量(I

System.out.print(请输入方形大小增量:!);

I = data_input .nextDouble()


只是希望有人可以帮我正确地获取输出,以便它显示与N对应的方形区域的数量,并且每种情况下的L增加与我相对应的金额,如果有人能帮助我,请提前感谢,将非常感激。谢谢

解决方案

你有程序的基础,那么为什么不创建一个简单的测试类,读入一些数据然后格式化输出直到它满足你的要求? / blockquote>

我不知道那些东西是什么,我的问题具体是如何使输出计算平方的数量和基于用户输入的大小增量,无论如何。 / blockquote>

任何人都知道我将如何做到这一点,我知道我必须创建一个数组,但我不知道该怎么做。


hi i dont know if this is the right place to be asking this but im trying to create a small program in java that can calculate the area of a square and then of multiple squares if the user enters the number of squares and the size increment of the squares,i.e.

// Get Length(L)
System.out.print("What is the length of the square: ?");
L = data_input.nextDouble();

// Get Number of square areas to calculate(N)
System.out.print("How many squares do you want to calclate: ?");
N = data_input.nextDouble();

//Get Square size increment(I
System.out.print("Please enter the square size increment: !");
I = data_input.nextDouble()

just hoping someone can help me to get the output correctly so that it shows the amount of square areas corresponding to N and that the L in each case increases by the amount corresponding with I, thanks in advance if anyone can help me, will be hugely appreciated. thanks

解决方案

you have the basis of the program so why not create a simple test class, read in some data and then format the output until it meets your requirements?


hi i dont know what those things are, my problem specificaly is how to make it so that the output calculates the amount of squares and by the size increment based on user input, thanks anyway.


anybody got any ideas of how i would do this, i know i have to create an array but i dont know what to do after that.


这篇关于帮助Java编程(使用JEdit)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆