Question: 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)

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!