Question: There is a serious logic error in the following code: if age < 2 0 then agecat = 1 ; else if age < 5

There is a serious logic error in the following code:
if age <20 then agecat=1;
else if age <50 then agecat=2;
else if age ge 50 then agecat=3;
else if age=. then agecat=9;
What is the logical error? What additional statement can be made to correct this coding error?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!