我需要帮助在bluej中创建方程式 [英] I need help creating an equation in bluej
本文介绍了我需要帮助在bluej中创建方程式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以弄清楚如何提示用户为N输入正确的变量,但我不知道如何使用给定的输入创建正确的方法来解决方程式N
等式是θ=(n-2)/ 2 * 180°
我尝试过:
我试过谷歌搜索并解构另一项任务,我必须提示用户输入变量a,b,c并通过二次方程运行变量并给出根作为输出
解决方案
你只需按照等式说明:
float theta;
float N;
// 从用户获取N的值
N = N - 2 。 0 ;
N = N / 2 。 0 ;
theta = N * 180 。 0 ;
I can figure out how to prompt the user to enter the correct variable for N but I dont know how to create the correct method to solve the equation with the given input for N
The equation is θ = (n-2)/2 * 180°
What I have tried:
I have tried googling it and deconstructing another assignment I had where I had to prompt the user to enter variables a, b, c and run there variables through the quadratic equation and give the roots as the output
解决方案
You just do what the equation states:
float theta; float N; // get value of N from user N = N - 2.0; N = N / 2.0; theta = N * 180.0;
这篇关于我需要帮助在bluej中创建方程式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文