Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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

Intelligent Information And Database Systems Third International Conference Achids 2011 Daegu Korea April 2011 Proceedings Part 2 Lnai 6592

Authors: Ngoc Thanh Nguyen ,Chong-Gun Kim ,Adam Janiak

2011th Edition

3642200419, 978-3642200410

More Books

Students also viewed these Databases questions

Question

=+2. Who are your opponents?

Answered: 1 week ago

Question

Count the significant digits in each of these measurements

Answered: 1 week ago