Question: Write a function called activity which takes an integer parameter X that does the following: Prints the heading Numbers: followed by all numbers from 1
Write a function called activity which takes an integer parameter X that does the following:
Prints the heading Numbers: followed by all numbers from 1 to X Prints the heading Evens: followed by all even positive numbers less than X Prints the heading Activity followed by the numbers from 1 to X with the following
replacement Multiples of 5 replaced with the string fiver Multiples of 7 replaced with the string ssss Other numbers printed as-is
6) Write a main method that prompts the user for an integer between 1 & 20 (inclusive). If the user enters an invalid number, prompt for another one. When a valid number is entered, call activity with that number as a parameter.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
