5 Replies - 229 Views - Last Post: 09 November 2011 - 11:33 AM Rate Topic: -----

#1 Ragine  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 07-November 11

Questions Help..

Posted 07 November 2011 - 12:20 AM

Okay so here's my question.

I have ten different numbers that keeps on changing, there's only one number maybe two that stop changing. I want to remove those numbers and keep on removing them if any stop. Also while all that is happening i want to find the closest number to a number that I've chosen, and then find the second, third, forth, and so on.
Is This A Good Question/Topic? 0
  • +

Replies To: Questions Help..

#2 hulla  Icon User is offline

  • Writing Lines


Reputation: 49
  • View blog
  • Posts: 732
  • Joined: 05-March 11

Re: Questions Help..

Posted 07 November 2011 - 12:46 AM

Show us what you have tried before we will help you.
This is to show us that you have put in some effort and are not using us to cheat on your homework assignments.
Was This Post Helpful? 1
  • +
  • -

#3 Ragine  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 07-November 11

Re: Questions Help..

Posted 07 November 2011 - 01:44 AM

First off i have no idea how to start on the first question i asked, but the last question is quit easy but the method i use is not very efficient.

First Question:
- What i have thought was to have a counter count each time the value changes and after 5 or so counts, if its still the same it will conclude that its a value that stopped and remove it.

Second Question:
- Is to subtract each number/value by the number that i have chosen. Example below.


int o = 10000;
int v;
int x = 600;
int b = 802;
int d = 230;
int t = 1000;
int y = 424;
int z = 432; //number that i have chosen 

		o = 10000;


	if (abs(x - z) < o)
	{
		o=abs(x - z);
		oo1 = z + o;
		oo2 = z - o;

			if (oo1 == x)
			{
			this->label5->Text = oo1.ToString();
			}
			if (oo2 == x)
			{
			this->label5->Text = oo2.ToString();
			}
	}

	if (abs(b - z) < o)
	{
		o=abs(b - z);
		oo1 = z + o;
		oo2 = z - o;

			if (oo1 == B)/>
			{
			this->label5->Text = oo1.ToString();
			}
			if (oo2 == B)/>
			{
			this->label5->Text = oo2.ToString();
			}
	}

	if (abs(d - z) < o)
	{
		o=abs(d - z);
		oo1 = z + o;
		oo2 = z - o;

			if (oo1 == d)
			{
			this->label5->Text = oo1.ToString();
			}
			if (oo2 == d)
			{
			this->label5->Text = oo2.ToString();
			}
	}

	if (abs(t - z) < o)
	{
		o=abs(t - z);
		oo1 = z + o;
		oo2 = z - o;

			if (oo1 == t)
			{
			this->label5->Text = oo1.ToString();
			}
			if (oo2 == t)
			{
			this->label5->Text = oo2.ToString();
			}
	}

	if (abs(y - z) < o)
	{
		o=abs(y - z);
		oo1 = z + o;
		oo2 = z - o;

			if (oo1 == y)
			{
			this->label5->Text = oo1.ToString();
			}
			if (oo2 == y)
			{
			this->label5->Text = oo2.ToString();
			}
	}

	//int oo1;
	//int oo2;
	this->label24->Text = oo1.ToString(); 
// Now either oo1 and oo2 can be correct, since i added one and subtract the other, simple fix is // to compare them to every other number first listed and if one matches then that's your number.
  
	this->label25->Text = oo2.ToString();
	this->label26->Text = o.ToString();
	}



Was This Post Helpful? 0
  • +
  • -

#4 hulla  Icon User is offline

  • Writing Lines


Reputation: 49
  • View blog
  • Posts: 732
  • Joined: 05-March 11

Re: Questions Help..

Posted 07 November 2011 - 02:17 AM

For the first question:
What happens if the value is 1.
Then it becomes 7.
Then 4.
Then 6.
Then 1 again and the counter sees it is 1?

This post has been edited by hulla: 07 November 2011 - 02:19 AM

Was This Post Helpful? 0
  • +
  • -

#5 Ragine  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 07-November 11

Re: Questions Help..

Posted 07 November 2011 - 12:35 PM

Thats fine as long as the value keeps changing, doesn't matter if it repeats it self.
Was This Post Helpful? 0
  • +
  • -

#6 hulla  Icon User is offline

  • Writing Lines


Reputation: 49
  • View blog
  • Posts: 732
  • Joined: 05-March 11

Re: Questions Help..

Posted 09 November 2011 - 11:33 AM

I mean, at every fifth interval it would check if it was the same result five intervals back. Because interval == interval-5, it would think the intervals were all the same. Or is it different?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1