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
arsen [322]
3 years ago
10

Write a program to print the prime numbers from 500 to 700. The program should also print the count of prime numbers between 500

and 700. A number is called a prime number if it has exactly two positive divisors, 1 and the number itself. For example, the number 5 is prime as it has only two divisors: 1 and 5.
Computers and Technology
1 answer:
S_A_V [24]3 years ago
8 0

primes = 0

for x in range(500, 701):

   count = 1

   for w in range(2, x+1):

       if x % w == 0:

           count += 1

   if count < 3:

       print(x, end=" ")

       primes += 1

print("\nThere are {} prime numbers between 500 and 700".format(primes))

I hope this helps!

You might be interested in
Determine the “answer” to the formula according to the spreadsheet below: =SUM(A1:D1).
MariettaO [177]
When you are trying to solve a formula like this one, you need to consider the whole row in the spreadsheet, not just A1 and D1.
So, A1:D1 refers to the whole row, which means that you need to add A1+B1+C1+D1 = 2 + 1 + 5 + 3 = 11.
The answer to the formula according to this spreadsheet is 11. 
6 0
4 years ago
Read 2 more answers
Each ticket has a unique number and a price. There are three types of tickets: walk-up tickets, advance tickets, and student adv
liberstina [14]

Answer:

import java.util.Scanner;

public abstract class Ticket   //abstract base class

   private int number;

   public Ticket(int number)

   

       this.number = number;

   

   public int getNumber()

   

       return number;

   

   public abstract double getPrice();

   public abstract String toString();

public class WalkupTicket extends Ticket

   public WalkupTicket(int number)

   

       super(number);

   

   public double getPrice()

   

       return 50;

   

   public String toString()

   

       return Number : +getNumber() +, Price : +getPrice();

   

public class AdvanceTicket extends Ticket

   private int days;

   public AdvanceTicket(int number)

   

       super(number);

   

   public AdvanceTicket(int number,int days)

   

       super(number);

       this.days = days;

   

   public double getPrice()

   

       if(days>=10)

       return 30;

       else

       return 40;

   

   public String toString()

   

       return Number : +getNumber() +, Price : +getPrice();

   

public class StudentAdvanceTicket extends AdvanceTicket

   private int days;

   public StudentAdvanceTicket(int number,int days)

   

       super(number);

       this.days = days;

   

   public double getPrice()

 

Explanation:

import java.util.Scanner;

public abstract class Ticket   //abstract base class

   private int number;

   public Ticket(int number)

   

       this.number = number;

   

   public int getNumber()

   

       return number;

   

   public abstract double getPrice();

   public abstract String toString();

public class WalkupTicket extends Ticket

   public WalkupTicket(int number)

   

       super(number);

   

   public double getPrice()

   

       return 50;

   

   public String toString()

   

       return Number : +getNumber() +, Price : +getPrice();

   

public class AdvanceTicket extends Ticket

   private int days;

   public AdvanceTicket(int number)

   

       super(number);

   

   public AdvanceTicket(int number,int days)

   

       super(number);

       this.days = days;

   

   public double getPrice()

   

       if(days>=10)

       return 30;

       else

       return 40;

   

   public String toString()

   

       return Number : +getNumber() +, Price : +getPrice();

   

public class StudentAdvanceTicket extends AdvanceTicket

   private int days;

   public StudentAdvanceTicket(int number,int days)

   

       super(number);

       this.days = days;

   

   public double getPrice()

 

7 0
3 years ago
Which group is not found on the sparkline tools design tab? a. format b. type c. show d. style
VashaNatasha [74]
Format sparkline tools design tab
4 0
3 years ago
What two variables does mass depend on?
Ber [7]

Answer:       The answer to your question would be A

have a good day

Explanation:

4 0
4 years ago
Isabela wants to add an image to her presentation. Which tab should she use?
den301095 [7]
The “add image” tab ??
8 0
3 years ago
Other questions:
  • Which keyword helps you remember how to operate an extinguisher? A. MASH B. PASS C. PASH D. DASH
    11·2 answers
  • Which option best describes the cheapest way to file your federal income taxes?
    5·1 answer
  • Choose the web design factor from the drop-down menus that best represents each statement. A. Good web pages stick to the point,
    15·1 answer
  • Why do organizations create multiple databases?
    12·1 answer
  • Can you shoot video on the Olympus E-410?
    12·2 answers
  • Which statement best describes an advantage of using the Subtotal dialog box?
    14·1 answer
  • 2.11 (Separating the Digits in an Integer) Write a script that inputs a five-digit integer from the user. Separate the number in
    12·1 answer
  • In the graph shown here, by what percentage are the number of people in computer occupations in general projected to increase?
    10·2 answers
  • Is it safe for me to use normal glue to stick things on my laptop like stickers or pics?
    12·2 answers
  • Submitting Unit 11 Assignment – Step 1 Python CS Fundamentals<br> Need the code to this.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!