Computers and Technology

Your friend is writing a program that will allow the user to input a year and then print “LEAP!” if that year is a leap year or print “not a leap year” if it is not. However, the program isn’t working properly, and your friend asked you for help in debugging. Before you take a look at the program, you should know these rules for leap years:

A year is a leap year if it can be divided by 400 without a remainder.
A year is a leap year if it can be divided by 4 without a remainder, unless it can also be divided by 100 without a remainder; if that is the case, it is not a leap year.
All other years are not leap years.
Here is your friend’s code:

year=int(input()
if year%400=0:
print("LEAP!")
else:
print(not a leap year")
elseif year%4==0 and year%100!=0
print(“not a leap year")

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:10, Olaf2018
Drag each label to the correct location on the imagelist the do’s and don’ts of safeguarding your password. keep yourself loggedin when you leave your computer. don’t write your password down and leave it whereothers can find it. share your password with your friends. each time you visit a website, retain the cookies on your computer. use a long password with mixed characters.
Answers: 1
image
Computers and Technology, 23.06.2019 22:20, Izzyfizzy
Read “suburban homes construction project” at the end of chapters 8 and 9 (in the textbook) and then develop a wbs (work breakdown structure) in microsoft excel or in microsoft word (using tables)
Answers: 1
image
Computers and Technology, 24.06.2019 17:00, 322993
Following are uses of spreadsheets. for each use, choose whether the use is a business use, consumer use, or student use. family budget: sales data: recording research data for science class:
Answers: 2
image
Computers and Technology, 24.06.2019 18:00, aleyshamar14p95561
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best-suited for this?
Answers: 1
Do you know the correct answer?
Your friend is writing a program that will allow the user to input a year and then print “LEAP!” if...

Questions in other subjects: