Write a program that fnds all prime numbers

Assignment Help C/C++ Programming
Reference no: EM132088464

Part a. **22.8

(All prime numbers up to 10,000,000,000) Write a program that fnds all prime numbers upt o 10,000,000,000. Ther are approximately 455,052,511 such prime numbers. Your program should meet the following requirements.

* Your program should store the pirme numbers in a binary data file, named PrimeNumbers.dat. When a prime number is found, the number is appended to the file

* To find whether a new number is prime, your program should load the prime numbers from file to an array of the long type of size 10,000. If no number in the array is a divisor for the new number, continue to read the next 10000 prime numbers from the data file, until a divisor is found or all numbers in the file are read. If no divisior is found, the new number is prime.

--- Part b. Implement a method that open file PrimeNumbers.dat and perform the following

(NUmber of prime numbers) Programming Exercise 22.8 stores the prime numbers in afile named PrimeNumbers.dat. Write a program that finds the number of prime numbers that are less than or equal to 10, 100, 1,000, 10,000, 100,000, 1,000,000, 10,000,000, 100,000,000, 1,000,000,000, and 10,000,000,000. Your program should read the data from PrimeNumbers.dat

(sidenote) If possible, can this be shown through a program like eclipse or something similiar, I'm fairly new to this and I'm afraid I might mess things up so I'm seeking for expertise. Thank you for taking your time to read this.

Reference no: EM132088464

Questions Cloud

Blood and the amount of carbon monoxide in blood : How is the amount of oxygen limited in its bonding to HB by the pH of the blood and the amount of carbon monoxide in blood
Amount of oxygen in human blood : How does the amount of oxygen bond to HB vary with the amount of oxygen in human blood, such as in the partial pressure exerted by oxygen?
What is the spatial resolution of the panchromatic band from : Add the three bands to the composer: display the first band (njolo1) and then add the others by right clicking on their names in the IDRISI explorer.
Blood vessel that receives lymph from the thoracic duct : What is the blood vessel that receives lymph from the Thoracic Duct? and the Right Lymphatic Duct?
Write a program that fnds all prime numbers : Write a program that fnds all prime numbers up to 10,000,000,000.
Provide an environment for immune responses to take place : What are the structures that filter lymph and provide an environment for immune responses to take place? couldn't find answer anywhere for question
How does the amount of oxygen bond : How does the amount of oxygen bond to HB vary with the amount of oxygen in human blood, such as in the partial pressure exerted by oxygen?
Create a java program that interviews the users : Create a Java program that interviews the users about their personal information, how many jobs they have and what the income is from each of their jobs.
Vessel that receives lymph from the thoracic duct : What is the blood vessel that receives lymph from the Thoracic Duct? and the Right Lymphatic Duct?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd