随机化计算变量。 [英] Randomizing Calculation Variables.

查看:93
本文介绍了随机化计算变量。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!


我正在做一个我不知道从哪里开始的项目,因为我在编程方面非常糟糕,因此,之所以如此我在这里发帖首先,我的项目主管希望我们使用以下程序:


1. Visual Web Developer

2. Visual Basic

3. SQL


他希望我们提出一个允许用户输入等式的代码,但变量可以随机化,这意味着......


y = mx + c


变量为''x''和''c''。


因此,在输入y = mx + c(最有可能必须提供界面)之后,变量将在每次人开始测验时随机化。


*必须是硬编码的。


用户是不关心幕后发生的事情的人,这意味着,他们不想与编码,它必须是用户友好的。我如何能够根据我可以使用的代码语言使编码工作。


提前感谢您的帮助!

- Denise


p / s您可以发送电子邮件至 denisetay17@hotmail.com

解决方案

您可以做的一件事是列出您认为可能使用的所有方程式,提示用户单击其中任何一个,然后要求用户输入值对于各个变量。


另一种方法是你可以在一个字符串变量中得到方程,计算所涉及的变量数量(不包括数字和运算符,所有其他字符都是变量),形成一个一般方程式,将它与你必须确认输入方程式属于哪种类型的方程式列表进行比较。


i还有其他的说法..这个网站不适合培训那些人编程很糟糕,而不是开发人员的网站世界分享他们的观点和解决一般问题的方法。


^。^


首先,你需要一些东西评估数学表达式,查看本文


一旦你可以评估它们,你可以做这样的事情(使用文章中的EVAL函数),请注意这是一个简单的例子,它可以明显改进(文章的代码也可以):

展开 | 选择 | Wrap | 行号


哦,谢谢大家的帮助:)真的很感激。首先要做界面,甚至我不太了解代码,我会尽我所能。洛尔。

Hi everyone!

I''m currently working on a project where I have no idea where to begin because I''m really bad at programming and thus, the reason why I''m posting here. To start off with, my project supervisor wants us to use the following programs:

1. Visual Web Developer
2. Visual Basic
3. SQL

He wants us to come up with a code that allows users to enter a equation but the variables can be randomized, meaning...

y = mx + c

The variables being ''x'' and ''c''.

So after you type in y = mx + c (most likely must come up with interface), the variables are to randomize themselves every time a person starts the quiz.

*Must not be hard coded.


The users are people who do not care what goes on behind the scenes, meaning, they want nothing to do with the codings, and it must be user friendly. How will I be able to make the codings work like that based on the code language that I am allowed to work with.

Thanks for the help in advance!
- Denise

p/s You can email me at denisetay17@hotmail.com

解决方案

One thing you can do is make a list of all the equations you think the use might use,prompt the user to click any one of them and then ask the user to enter values for respective variables.

Another method is you can get the equation in a string variable,calc the number of variables involved(excluding the numbers and operators all other characters are variables),form a general equation,compare it with the list of equations you have to confirm to which type the entered equation belongs.

i do have something else to say..this site is not for training people who are bad at programming,rather a site for developers across the world to share their views and ways of solving general problems.


^.^

First of all, you''ll need something to evaluate mathematical expressions, check this article out.

once you can evaluate them, you can do something like this (using the EVAL function from the article), please note this is a simple example and it can clearly be improved (so can the articles'' code):

Expand|Select|Wrap|Line Numbers


Oh thanks for the help everyone :) Really appreciate it. Gotta do up the interface first and even tho'' I don''t really understand the codes, I''ll do the best of my ability. Lol.


这篇关于随机化计算变量。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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