CpSc 146 Assignment 4
Repetition Programming
Fall 2022

The objective of this assignment is to use all three loop types AND the switch statement.
You are to write a menu driven program (good place for a do loop) that has three options (good place for a switch statement):

  1. Count up to N by Step: Use a for loop
    Request the numbers(i.e., N and Step) from the user and output the numbers from 1 to N.
    If N is below 1, output an error message.
  2. Count down to N by Step: Use a for loop
    Request the numbers (i.e., N and Step) from the user and output the numbers from N down to 1.
  3. Base 2 conversion - Use a while loop
    Request a base 10 number between 1 and 1,000 and report the binary equivalent of the number.
The program must: To hand this program in, place the code in the Assign4 folder in D2L.

Need some help? Try this

Binary conversion code Try this