473,804 Members | 3,790 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Randomizing Calculation Variables.

6 New Member
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@hot mail.com
Sep 2 '08 #1
11 1656
vdraceil
236 New Member
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(exclud ing the numbers and operators all other characters are variables),form a general equation,compar e 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,rat her a site for developers across the world to share their views and ways of solving general problems.
Sep 2 '08 #2
kadghar
1,295 Recognized Expert Top Contributor
^.^

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
  1. 'this little example will search every letter form a to z, using its ascii code (from 97 to 122) and the REPLACE function.
  2. '
  3. dim str1 as string
  4. dim i as integer
  5. randomize
  6. str1= inputbox("write the function here")
  7. for i = 97 to 122
  8.     str1=replace(str1, chr(i),rnd*100)
  9. next
  10. msgbox str1 & " = " & eval(str1)
I think that'll give you a good idea, and can be quite general for any purpose

I tried it with a+b*c (it'll give you the other side, son dont write both sides of ecuation, write only one) and returned:

81.59072+74.970 83*78.8576 = 5993.610443808

^.^ nice!!

Anyway, im sure that with some time you can improve this quite a bunch.

HTH
Sep 2 '08 #3
yourstonight
6 New Member
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.
Sep 3 '08 #4
yourstonight
6 New Member
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(exclud ing the numbers and operators all other characters are variables),form a general equation,compar e 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,rat her a site for developers across the world to share their views and ways of solving general problems.

I merely asked a question that you could have chosen not to reply. The website says I could ask questions. It doesn't say you can't ask, if you're bad at programming. Thanks for your reply but you didn't understand the question in the first place.
Sep 3 '08 #5
vdraceil
236 New Member
I merely asked a question that you could have chosen not to reply. The website says I could ask questions. It doesn't say you can't ask, if you're bad at programming. Thanks for your reply but you didn't understand the question in the first place.
Sorry buddy..i didnt mean to hurt you..really sorry
Sep 3 '08 #6
yourstonight
6 New Member
Sorry buddy..i didnt mean to hurt you..really sorry
Sorry too, I'm just running out of places to get help. :(
Sep 4 '08 #7
kadghar
1,295 Recognized Expert Top Contributor
Sorry too, I'm just running out of places to get help. :(
dont worry, i think we can work this out quite fine. ^.^

did you get to make it work?
Sep 4 '08 #8
yourstonight
6 New Member
I used another method to make it work but I haven't figured out how to integrate the randomization code into it yet. I just managed to do up the interface and make y=mx+c
Sep 5 '08 #9
jg007
283 Contributor
at the moment I don't have anything to add but I would really recomend against posting your email address in a public forum as it is all too easy to get on a spammers list and it is a much better option to state that you can be pm'd

if you do wish to post an email address it is better to try and hide it from some of the spider programs by at least removing the @ sign

Somebody<insert @ here>anywhere.n et
Sep 5 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4000
by: Susanna | last post by:
Hi all, I'm using the following slideshow script that I found on the web to display changing images with a crossfade effect. Eventually I will be adding many more images to the slideshow. The thing is, I ALSO have to make it so the images will load randomly. I have looked at a number of scripts for random-loading slideshows, but I have to find a way to COMBINE this fading-image script (or, a different fading-image script, if...
10
1952
by: Michael G | last post by:
double A = floor((2447297.0 - 122.1)/365.25); i get differing results. It varies between 6699 and 6700. The correct answer is 6699. The 6700 result really throws the entire group of calculations off. Any suggestions welcome. Thanks Mike
0
2487
by: anaxamandr | last post by:
Hi. I have a long loop in ASP that performs a rather lengthy calculation. I would love for my users to be able to stop that calculation, if they so choose, mid way through the process. I attempted to use a parent window that allows the user to launch the calculation in a seperate window, so that they could still click "stop" to write a value to a database or set a session level variable that the calculation would check to see if it should...
7
2248
by: th-ko | last post by:
Hi, I would like to know whether a certain coding pattern exist to handle the following problem. I am using a const methode to get and value a from the class. In case the value was not calculated yet, I want to start the calculation (which is not a const methode) and return the value. But since the calculation is not const, I can't call it within the getter. Any ideas? Thanks in advance, Thomas Kowalski
28
2666
by: beach.dk | last post by:
Hi, I'm trying to implement a simple hash algorith called rs_hash in javascript, but I cannot get a correct result. In c the code looks like this:
2
1400
by: andre.ditador9999 | last post by:
I want to randomize a certain calculation in Python but haven't figured it out yet. To explain what i mean, I' m going to use an example: I want to get the numbers to do a random experience database for a game. What would be necessary to do so?
5
6263
by: The alMIGHTY N | last post by:
Hi all, Let's say I have a simple math formula: sum (x * y / 1000) / (sum z / 1000) I have to do this across 50 items, each with an x, y and z value, when the page first loads AND when a user modifies any of the x, y and z values.
19
9441
by: LucasLondon | last post by:
Hi there, First of all apologies for the long post. Hope someone can offer some advice. I have about 200 columns of time series data that I need to perform a correlation analysis on in terms calculating lagged cross correlations between all the variables. Currently the data is stored in Excel. Variable 1 is in Column A, variable 2 in Column B etc, the data ends in column GR which contains the last variable. I need to calculate the...
5
1552
by: =?Utf-8?B?ZG9uZGlnaXRlY2g=?= | last post by:
I having problems getting this function to return the correct value. Basically I have a curveDataCalc method that loops as it should, but just doesn't seem to be working right. I've stepped through the function and the variables are being passed through correctly its just the clocksPerQREV and calcAngleTime are never being calculated and are always zero. This causes the other values to incorrectly calculated, ultimated giving me the wrong...
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9576
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10568
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10074
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2988
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.