Question

assuming this snippet of pseudocode is sitting by itself with nothing written above or below it,...

assuming this snippet of pseudocode is sitting by itself with nothing written above or below it, what, if anything, is wrong with it?

int currentYear = 2250;
int age = currentYear-birthYear;
Display age;

A. 2250 is not a valid value for an integer type variable

B. it is perfectly fine

C. we are trying to do a subtraction operation on some variable that has not been assigned a value. (it is not defined yet).

D. we should be calculating the age before we set the currentYear:

int age = currentYear - birthYear;
int currentYear = 2019 ;

(There can be multiple Answers)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

C. we are trying to do a subtraction operation on some variable that has not been assigned a value. (it is not defined yet).

Add a comment
Know the answer?
Add Answer to:
assuming this snippet of pseudocode is sitting by itself with nothing written above or below it,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT