Sat, 14th Nov 2015, 01:24 Re: EE 306 Lab 3 question

```

A student writes:

> Hello Dr. Patt,
>
> I have a question about how the assignment statements on the third lab
> assignment should be written.
>
> Does a proper assignment statement have to contain only up to two integers
> and one operation? Would y=(5+3+2);, for example, be considered a bad
> expression? That is, in order for it to be a valid, would it have to be
> written as y=((5+3)+2); or y=(5+(3+2));?
>
> Thanks,
>
> <<name withheld to protect the student who wants to change the rules>>

I have received about a half dozen emails on this, so I decided it is time
to send the answer to the whole class.

Of course there are lots of ways one can define an expression.  For purposes
of this lab in order to make it easier for you to write the program, I chose
to define an expression in ONE specific way.  That is, an expression E is
either a single decimal digit or it is an expresssion of the form
( E Operation E ).  All assignment statements your program will be asked to
evaluate will be of this form.  I gave you several correct examples -- and one
incorrect example as it turns out :-( -- on the assignment page.

Your example y=(5+3+2) does not follow my definition, so yes, it would be
considered a bad expression.  Yes, for it to be valid, it would have to be
written as you suggested: y=((5+3)+2); or y=(5+(3+2));

Good luck finishing the lab on time, and good luck with the rest of the course.

Yale Patt

```