Help me understand! pls?

Hi!

I am not asking for you to build the program but can you explain to me what does this mean? I mean what does it want to have in the C++?

Derive the flowchart to carry out the following
steps then implement it in C program :
a. Store the absolute difference of x and
y, where the absolute difference is
(x-y) or (y-x), whichever is positive.
Do not use the abs or fabs function in
your solution.
b. If x is 0, add 1 to zero_count. If x
is negative, add x to minus_sum. If x
is greater than 0, add x to plus_sum.


Thanks!
It means what it say!? i.e. it's telling you can variables to use and what calculations to perform.

It does read pretty clearly to me. Except I would prob. have just said "Draw the flowchart..."
^
dont mind about the flow chart.:))

a. and b. will be built in only one program right?
I cant understand can you please explain it to me?
I understand about the letter a.
I am confused about the letter b.
Yes, a and b refer to the same program

b is a set of conditional test and their associated actions.
x of (b.) refers to the x of (a.)?
or
the x of (b.) refers to the absolute difference of x and y?

and I cant understand the statement in letter b. like If x is 0, add 1 to zero_count.

What does it mean?
"zero_count", "minus_sum" and "plus_sum" are all variables that you are supposed to create. It's implied but not directly stated, at least not in the excerpt that you provided.
^
that was the only instruction that was given to me.
What value or equation do I need to assign to the variables that you mentioned?
Last edited on
I can see your point about the variable x in (b) vs (a). A given variable is normally defined once. so the x in (b) should be the same one as in (a). But given the maths, it looks like it should be using the absolute difference.

If I came across confusion of that kind, I'd e-mail the guy who wrote the spec. It's not that uncommon for confusion to turn up!

You could state your assumptions, once you decide which to use, and then just go with it.

The only variables whose value is uncertain are the counts.
The only variables whose value is uncertain are the counts.


so the "zero_count", "minus_sum" and "plus_sum"
doesnt really have values or equations?
if thats the case it's quite impossible to do this?
In would of thought

add 1 to zero_count


is easy to convert to mathematical form?

The counts are uncertain in that their starting value it not stated.
Topic archived. No new replies allowed.