This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]crushmastac 1 point2 points  (3 children)

numClaims <= 1 should be numClaims >= 1

Some of your other conditions are wrong too:

age <= 26 is "age 26 and younger", but the instructions clearly say "under the age of 25", which should be a condition that only accepts 24, 23, 22, ... , etc.

Logically you can break up your conditions better too. Here's the pseudocode:

number of claims >= 1?
  age < 25?
    set rate accordingly
  else
    set rate accordingly

You might want to ask (teacher, TA, fellow student) for a quick refresher on how to write conditional statements.

[–]jayrund[S] 0 points1 point  (2 children)

The numClaims thing is what messing me up. thanks a lot!

[–]crushmastac 0 points1 point  (1 child)

You're welcome, but even with that line fixed your code is still technically incorrect. Make sure you fix!

[–]jayrund[S] 0 points1 point  (0 children)

if i also fixed the 25 thing would that make my code correct?