Question: Generic Grading Guidelines a. Please make sure youre only using the concepts already discussed in class. That is, please try and restrict yourself to loops,
Generic Grading Guidelines
a. Please make sure youre only using the concepts already discussed in class. That is, please try and restrict yourself to loops, selection statements, String methods that talked on class, arrays, and your own written methods. b. The programs are worth 35 points, 35 points, 30 points. c. You do not need to perform any form of input type checks. d. Please make sure that youre conforming to specifications (program name, print statements, expected inputs and outputs etc.). e. Please make sure your code is readable. f. Please make sure youve compiled and run your program before you turn it in. -5 pts will be deducted for each compile error.
1. Prime.java Write a program to print all the prime numbers below a certain given number. A prime number is defined as a number that can only be divided by 1 and itself. For example, 2, 3, 17 and 41 are all prime numbers. Make sure your program conforms to the following requirements: a. Using Scanner class, accept the upper limit from the user (as an integer). b. You can assume the user input will be positive and smaller than INT MAX. c. Using for loop, go from 1 to the number. If you happen to find a number that is prime, print it. The input and output should match the sample run perfectly. Sample run 1: Enter the upper limit: 25 The prime numbers are: 2, 3, 5, 7, 11, 13, 17, 19, 23 Sample run 2: Enter the upper limit: 70 The prime numbers are: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
