Answer:
- Class is created with name PrimeFactorisation.
-
isPrime(int num) is a method-> it will check whether the number given as a parameter is prime or not in time equal to O(sqrt(num)).
-
printPrimeFactors(int num) -> a recursive method for printing the prime factors.
-
Main method will be written to take a integer as input from user a.
We know that if a no x if divisible by y. than (y) and (x/y) are its factors and if they are prime numbers also , then they will be the prime factors.
Using this concept you can make recursive calls printPrimeFactors(y), printPrimeFactors(x/y).
Explanation:
The code in java is explained below in image using comments before each statement.
The output image is also attached.
Answer:
A program that converts a program to binary
all at once and runs the entire program when
finished with the conversion is known as a
compiler.
Explanation:
A Compiler is a computer program that
transfornms a whole program into machine
code at once. The compiler does this
by converting source codes written in
a programming language to another
programming language such as:
assembly language,
object code etc.
The compiler does this in order to build an
executable program.
Clamp style anchor is the answer amongst the choices although for smaller boats a fluke style anchor would be best. Although a clamp style would be cheaper and more practical.
import datetime
name = input("What is your name? ")
age = int(input("How old are you? "))
year = datetime.datetime.today().year
print("Hello {}! You were born in {}.".format(name, year - age))
I hope this helps!