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

Step: 3

blur-text-image

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

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions