Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the U . S . , presidential elections occur every 4 years. Write a program that prints election years from 1 9 0 0

In the U.S., presidential elections occur every 4 years. Write a program that prints election years from 1900-2000, thus printing 1900,1904,...,1996,2000.
Suggestion: Copy-paste the above ancestors program and modify the program little-by-little into the desired program:
Copy-paste the ancestors program, and run.
Replace the word ancestors by year throughout, and run; output should be the same as before: 2,4,8,...
Replace ancestors =2 by year =1900, and run; output should look strange (1900,3800,...).
Replace the "2*" by "4+", and run; output should be 1900,1904,...
Change the for loop's 8 to the appropriate higher number, run.
Change the print instruction as you desire.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions