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
icang [17]
3 years ago
11

#Write a function called is_composite. is_composite should #take as input one integer. It should return True if the #integer is

composite, False if the integer is not not #composite. You may assume the integer will be greater than #2 and less than 1000.
Computers and Technology
1 answer:
malfutka [58]3 years ago
3 0

Answer:

// A optimized school method based C++ program to check  

// if a number is composite.  

#include <bits/stdc++.h>  

using namespace std;  

bool isComposite(int n)  

{  

// Corner cases  

if (n <= 1) return false;  

if (n <= 3) return false;  

// This is checked so that we can skip  

// middle five numbers in below loop  

if (n%2 == 0 || n%3 == 0) return true;  

for (int i=5; i*i<=n; i=i+6)  

 if (n%i == 0 || n%(i+2) == 0)  

 return true;  

return false;  

}  

// Driver Program to test above function  

int main()  

{  

isComposite(11)? cout << " true\n": cout << " false\n";  

isComposite(15)? cout << " true\n": cout << " false\n";  

return 0;  

}

Explanation:

You might be interested in
A major way the National Information Infrastructure Protection Act of 1996 amended the Computer Fraud and Abuse Act was the subs
Kaylis [27]

A major way the National Information Infrastructure Protection Act of 1996 amended the Computer Fraud and Abuse Act was the substitution of the term <u>protected </u>computers for federal interest computers so that the statute now protects any computer attached to the Internet.

<h3>What is the National information infrastructure protection act?</h3>

It is an amendment act of Computer Fraud and Abuse Act and was enacted in 1996. The act is for the cyber crimes and frauds.

Thus, the correct option is protected.

Learn more about National information infrastructure protection act

brainly.com/question/13371540

#SPJ1

3 0
2 years ago
A mobile base station (BS) in an urban environment has a power measurement of 15 µW at 175 m. If the propagation follows an inve
PIT_PIT [208]

Answer:

The reasonable power will be "0.234 μW".

Explanation:

The given values are:

P = 15 μW

d = 175 m

As we know,

Propagation follows inverse cube power law, then

∴  Power \ \alpha \ \frac{1}{d^3}

⇒ Power=\frac{K}{d^3}

On substituting the estimated values, we get

⇒  15\times 10^{-6}=\frac{K}{(173)^3}

⇒  K=15\times (175)^3\times 10^{-6}

Now,

"P" at 0.7 km or 700 m from BS will be:

⇒  P=\frac{K}{d^3}

⇒  P=\frac{15\times (175)^3\times 10^{-6}}{(700)^3}

⇒  P=0.234 \ \mu W

6 0
3 years ago
In the computing environment the numerical value represented by the pre-fixes kilo-, mega-, giga-, and so on can vary depending
nignag [31]

Answer:

1024 bytes in a megabyte and there are 8000000 bits in a megabyte. They are different.

Explanation:

5 0
3 years ago
Write a simple hello world program in python 3
IRINA_888 [86]

Answer:

print("hello world")

Explanation:

a hello world program is simply a program that prints out hello world.

for this you would need to remember to have the same number of brackets on each side and to write print. Also remember when printing to include speech marks.

6 0
3 years ago
Read 2 more answers
g Create a public non-final generic class called YourSimpleLinkedList. You should extend SimpleLinkedList which is parameterized
larisa86 [58]

Answer:

See explaination

Explanation:

class YourSimpleLinkedList<E> extends SimpleLinkedList<E> {

public boolean search(E value) {

if (value == null)

throw new IllegalArgumentException();

Item temp = start;

while (temp != null) {

if (temp.value.equals(value))

return true;

temp = temp.next;

}

return false;

}

}

3 0
3 years ago
Other questions:
  • Explain how abstraction is used in a GPS system
    12·2 answers
  • An expression using the logical operator ____ will evaluate to true when either of the compound conditions is true.
    6·1 answer
  • How to change font size and style and add a table when creating a webpage?
    6·1 answer
  • 4. How can you select non-adjacent cells (i.e. cells that are not all together in one block)?
    5·2 answers
  • The GeForce GTX 1060 graphics card requires 120 W of power. You plan to install it in a PCIe 3.0 ×16 slot. Will you need to also
    13·1 answer
  • In ________ for final fields and methods the value is assignedlater but in ______ you assign the value during declaration.
    15·1 answer
  • so im doing this school challenge and the teachers said whats the average text a student gets a day so i need to get about 20 in
    13·2 answers
  • A key tactic that is used in many attacks, but very frequently in CEO Fraud, is creating a sense of what?
    15·2 answers
  • A human interest story is an example of hard news.<br> O True<br> O False HEL
    15·1 answer
  • An 802. 11 frame contains a number of fields. Which field describes the version of 802. 11 that is being used?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!