Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me with the following Java program. First Program You do not have to read any inputs from a file or a user, you

Please help me with the following Java program.

First Program

You do not have to read any inputs from a file or a user, you may hard code the start and end values in main as long as you pass them to the function (the primeTable function must take these values in and cannot hard code them).

The only difference between methods done in JAVA and your c++ functions are that you will need to include the word 'static' in your method header. The example given here prints out a simple message but make certain it is in the scope block of your class where the main function is located (it can be above or below main without issue):

static void thisIsAFunction()

{

System.out.println("Hey I'm a function");

}

The actual goal of this method/function is to take in 2 inputs (as int's) a start, and an end. Between these 2 values your function will output a table of all the prime numbers between start and end with all the multiples of them.

image text in transcribedimage text in transcribed
Prime's table between 14 and 38: 17 19 23 29 31 37 17: 289 323 391 493 527 629 19: 323 361 437 551 589 703 23: 391 437 529 667 713 851 29 : 493 551 667 841 899 1073 31: 527 589 713 899 961 1147 37: 629 703 851 1073 1147 1369Prime's table between 4 and 20: 5 11 13 17 19 5: 25 35 55 65 85 95 7: 35 49 77 91 119 133 11: 55 77 121 143 187 209 13: 65 91 143 169 221 247 17 : 85 119 187 221 289 323 19: 95 133 209 247 323 361

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

What is the Normal Eye Power ?

Answered: 1 week ago

Question

Thomas Aquinas was born........?

Answered: 1 week ago

Question

Aristotle of ideal state features?

Answered: 1 week ago