1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Pani-rosa [81]
4 years ago
6

Make a java program to enter a two-digit integer and determine if both digits are prime

Computers and Technology
1 answer:
Andre45 [30]4 years ago
8 0
Package com.java2novice.algos; public class MyPrimeNumCheck {     public boolean isPrimeNumber(int number){                 for(int i=2; i<=number/2; i++){            if(number % i == 0){                return false;            }        }        return true;    }         public static void main(String a[]){        MyPrimeNumCheck mpc = new MyPrimeNumCheck();        System.out.println("Is 17 prime number? "+mpc.isPrimeNumber(17));        System.out.println("Is 19 prime number? "+mpc.isPrimeNumber(19));        System.out.println("Is 15 prime number? "+mpc.isPrimeNumber(15));    }

You can find this code at
http://www.java2novice.com/java-interview-programs/is-prime-number/

You might be interested in
Manipulating graphic images to perform a command has replaced the ____ user interface.
Alekssandra [29.7K]

Answer:

The answer is "Command-based".

Explanation:

CLI stands for the command-line interface, it is also known as the command-based user interface. CLI is a text interface that allows the user to react to visual prompts by typing individual commands in the interface and receiving the same response.

  • It is available on Microsoft windows.
  • CLI is the way that is used by users to interact with computer programs.

3 0
3 years ago
Choose the correct term to complete the sentence.
Rashid [163]

Answer:

Epoch

Explanation:

5 0
3 years ago
While (e &lt; 10):<br> print (c)
Ymorist [56]

Answer:

Huh? can you ask a real question so I can answer?

Explanation:

7 0
3 years ago
Write a program that reads the contents of the two files into two separate lists. The user should be able to enter a boy’s name,
insens350 [35]

Answer:

Check Explanation.

Explanation:

A programming language is used by engineers, technologists, scientists or someone that learnt about programming languages and they use these programming languages to give instructions to a system. There are many types for instance, c++, python, Java and many more.

So, the solution to the question above is given below;

#define the lists

boyNames=[]

girlNames=[]

#open the text file BoyNames.txt

with open('BoyNames.txt','r') as rd_b_fl:

boyNames=rd_b_fl.readlines()

boyNames=[name.strip().lower() for name in boyNames]

#open the text file GirlNames.txt

with open('GirlNames.txt','r') as rd_b_fl:

girlNames=rd_b_fl.readlines()

girlNames=[name.strip().lower() for name in girlNames]

#print the message to prompt for name

print('Enter a name to see if it is a popular girls or boys name.')

while True:

#prompt and read the name

name=input('\nEnter a name to check, or \"stop\" to stop: ').lower()

# if the input is stop, then exit from the program

if name=='stop':

break

# If the girl name exits in the file,then return 1

g_count=girlNames.count(name)

# if return value greater than 0, then print message

if g_count>0:

print(name.title()+" is a popular girls name and is ranked "

+str(girlNames.index(name)+1))

# if return value greater than 0, then print message

#"Not popular name"

else:

print(name.title()+" is not a popular girls name")

## If the boy name exits in the file,then return 1

b_count=boyNames.count(name)

if b_count>0:

print(name.title()+" is a popular boys name and is ranked "

+str(boyNames.index(name)+1))

# if return value greater than 0, then print message

#"Not popular name"

else:

print(name.title()+" is not a popular boys name")

3 0
3 years ago
The process of ensuring that web pages coded with new or advanced techniques still are usable in browsers that do not offer supp
grigory [225]

Answer:

progressive enhancement

Explanation:

Progressive enhancement is a powerful method for web developers when building websites accessible to different level user-agents.

Progressive enhancement technique allows you start with <em>simple</em> and <em>foundational</em> layers and then building more complex technologies on top of it. This principle lets multiple level user-agents can access and retrieve your work no matter what level of technologies they are using.

8 0
3 years ago
Other questions:
  • Pixels are small dots in columns and rows that allow an image to be seen on a display screen.
    6·1 answer
  • Which of the following mountain ranges stretches from Alabama to Canada?
    10·1 answer
  • The isometric projection camera technique provides an illusion of perspective by using things like parallax scrolling to create
    10·1 answer
  • Computer simulations can: A. accurately predict the weather a month in advance.
    11·1 answer
  • a password to a certain database consists of digits that cannot be repeated. if the password is known to consist of at least 8 d
    14·1 answer
  • Which part of the operating system enables you to interact with the device? Question 9 options: The graphical user interface The
    8·1 answer
  • State and give reason, if the following variables are valid/invalid:
    12·1 answer
  • guys look at this https://brainly.com/app/profile/17971193/answers i need help and tips to get this cute girl to give me her num
    14·2 answers
  • How do spear phishing attacks differ from standard phishing attacks?
    5·1 answer
  • If you want to design computing components for cars and medical
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!