About a project of processing .. I need a help

You might need to tell a bit more. Otherwise whatever we recommend is likely to come across as generic or out of place.

1 Like

Hello there is the all details about the project. i swear that you can help me.

We can help you but we won’t do your homework for you.
You need to provide codes of what you have tried and pinpoint exactly what you don’t understand or can’t manage to do.

we don’t have this leçon. For this i don’t understand how can I make the code . We have just ‘nombres complexes’ . I don’t know what’s the principle to do it. Specially the questions 3 and 7 , et 10.

First question, they ask you to code a euclide algorithm. Have you tried that?

Just saw you updated your first post.

i don’t have a idea how can i resolve the questions , we don’t have this lecon for this i don’t know

Not yet . i don’t know how to began

You have a link to a wikipedia article that explains how Euclide Algorithm is working.

The skeleton of your code should be like this:

void setup() {
  println(pgcd(21, 15));
}

int pgcd(int a, int b) {
  // TO DO
}

You need o replace “TO DO” with some code as explained in the wikipedia article.

can you explain me , the 3 and 7 and 10 questions

i’ll try with this .

Start with question one, you haven’t even started to create the Class so no need to worry about adding some methods to it yet.

it’s ok for the first question. can you explain me the methode of 3 et 7 and 10

I don’t know what to tell you, the questions are quite self explanatory:

Q3: They ask you to create a function that take the numerator and denominator and return a String (text) that represent the rational number. So if your numerator is 3 and denominator is 4 then it should return “3/4”

Q7: You need to compare your rational number against other rational numbers and integers. For example let’s imagine your rational number is 3/4 then myRationalNumber.inf(1) would return true because 3/4 is indeed lower than 1

Q10: You simply need to print in the console to result of the Leibniz formula using your toString() and val() functions

i don’t know how to do these

the questions are clear but i don’t know to resolve. i spent three days in this activities but i don’t find how to do it.

Again, if you are not willing to give us the code that you have so far then we can’t help you.

If you are wondering about question 3 then it means that you have done Q1 and Q2, so you already have coded a rational number class. Can we see it?

can you show your code that you made?

A function like void draw() doesn’t return anything (empty = void).

You want to return a float value as a String. So replace void with String

To make the function return a value, use return command

Here is an example with int.

int add2Numbers(int a1, int a2) {
  return a1 + a2; 
}

nominator and denominator is from a fraction, upper number and lower number
see Pinterest - Deutschland

return a1 + "/" + a2;

1 Like

Bonjour,

The Processing website has references, examples and tutorials here:
https://processing.org/

Other resources:

:)

To do it properly is is quite tricky see Problems with fractions - #3 by monkstone if you are still stuck. Look up ApacheMath implementation.