Question: 1. Program 1 - Prime Number Detector a. Using pseudocode, describe an algorithm that determines whether an integer entered by the user is a prime

1. Program 1 - Prime Number Detector

a. Using pseudocode, describe an algorithm that determines whether an integer entered by the user is a prime number. Prime numbers have exactly 2 factors. So, 31 is a prime number because it can only be formed by multiplying 31 * 1. But 32 is a composite number because it can be formed by 32 * 1, 16 * 2, and 8 * 4.

b. make a flowchart that visually represents the algorithm above.

c. Convert your pseudocode and flowchart into a JavaScript program.

2. Program 2 - Factorial Calculator

a. Using pseudocode, describe an algorithm that calculates the factorial value of an integer entered by the user. Factorials are calculated by multiplying the previous numbers together. So, 3! Is 3 * 2 * 1 or 6. 4! Is 4 * 3 * 2 * 1 or 24. Be aware that 0! = 1 and 1! = 1.

b. make a flowchart that visually represents the algorithm above. c. Convert your pseudocode and flowchart into a JavaScript program

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 Programming Questions!