Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1) Create an Eclipse project with a package named activities.activityo. 2) Write a method called activityo which takes an integer parameter X that prints the
1) Create an Eclipse project with a package named activities.activityo. 2) Write a method called activityo which takes an integer parameter X that prints the following 3 lines of output: Line 1: the heading "Numbers:" followed by all numbers from 1 to X Line 2: the heading "Evens:" followed by all even positive numbers less than X Line 3: the heading "Activity" followed by the numbers from 1 to X with the following criteria: In place of multiples of 3 print the string "three" In place of multiples of 5 print the string "five" Do not print multiples of 7 Other numbers printed as-is 3) Write a main method that prompts the user for an integer between 1 & 100 (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. Sample output: Enter a number between 1 & 100: 12 Num = 12 Numbers: 1 2 3 4 5 6 7 8 9 10 11 12 Evens: 2 4 6 8 10 12 Activity: 1 2 three 4 fiver three 8 three fiver 11 three
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started