Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab Description: Create a prime class that will determine if any provided number is prime. Use this class to tell all numbers in the


imageimage

Lab Description: Create a prime class that will determine if any provided number is prime. Use this class to tell all numbers in the data file for primeness. A prime number is any number that is only divisible by 1 and itself. Sample Data: 18 1201 77 1213 88 1217 99 121 1431 1223 141 234 97 47 7 547 2456 34 Sample Output: 1201 IS PRIME. 77 IS NOT PRIME. 1213 IS PRIME. 88 IS NOT PRIME. 1217 IS PRIME. 99 IS NOT PRIME. 121 IS NOT PRIME. 1431 IS NOT PRIME. 1223 IS PRIME. 141 IS NOT PRIME. 234 IS NOT PRIME. 97 IS PRIME. 436 IS NOT PRIME. 47 IS PRIME. 7 IS PRIME. 547 IS PRIME. 2456 IS NOT PRIME. 34 IS NOT PRIME. Files Needed :: Prime.java Prime Runner.java import static java.lang. System. *; import java.lang. Math; public class Prime { private int number; //constructor methods go here public void setPrime (int num) //boolean isPrime () goes here public String toString() { return import java.io.IOException; import java.io.File; import java.util.Scanner; import static java.lang.System.*; import java.lang.Math; public class PrimesRunner { public static void main( String args[]) throws IOException 18 1201 77 1213 88 1217 99 121 1431 1223 141 234 97 436 128 92 47 7 547 2456 34

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_2

Step: 3

blur-text-image_3

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

Introduction to Java Programming, Comprehensive Version

Authors: Y. Daniel Liang

10th Edition

133761312, 978-0133761313

Students also viewed these Computer Network questions

Question

=+8. For the decision tree of Exercise 4,

Answered: 1 week ago