One time for the entire number set

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

Part A) create a program that will read in one of a list of integers and test to see whether or not each one is

prime (the numbers are listed in the file "ints.txt" ).

Note the file "ints.txt" contains:

8
25
101
5001
10213
56777
765321
317971
1028743
23498271
987278023
1768374681

You must run your program one time for the entire number set. Test for EOF (or use the function feof()) to know when to stop

processing. You are to determine if each integer read is prime or not, and output the result to stdout. If a

number is prime, your output should read:

101 = 1 x 101

101: PRIME Number

For a number that turns out not to be prime, your output should read:

333 = 1 x 333 333 = 3 x 111 333 = 9 x 37 333: NOT A PRIME Number
(Note:use loops, conditionals and flags in the program)
PartB) Revise your program of Part A to handle a range of integers as specified by the user. You are to only make minor changes to your code. Such changes might include changing the state of the display_factors flag as well as changing the structure of your outer loop. In part (b), your output should now just list ONLY the prime numbers in the given range and NOT the intermediate factors OR the numbers that are not prime. Only test for ranges that have a start number greater than 3. For example, the user can request the program to find all prime numbers in the range of 900 to 1000. In this case, the output should be the following: 907: PRIME Number 911: PRIME Number 919: PRIME Number 929: PRIME Number 937: PRIME Number 941: PRIME Number 947: PRIME Number 953: PRIME Number 967: PRIME Number 971: PRIME Number 977: PRIME Number 983: PRIME Number 991: PRIME Number 997: PRIME Number
Pls Make sure to Post both Codes(part A and B) and flowchart(if u can)

Reference no: EM13167907

Questions Cloud

Calculate the number of bridge hands : Calculate the number of bridge hands which contain and calculate the probability of being dealt each of the hands in parts (a), (b), and (c). Give your answers to 5 decimal places.
Categorize the efficiency in terms : Consider the followimg nested loop contruct. Categorize the efficiency in terms of the variable n using "big-O" notation. Suppose the statements represented by the elipsis
Define an error limit for approach : To construct the Hermite polynomial to approximate the price sin0.34 and define an error limit for approach used and compared with the actual error.
What dangerous chemical is released : when hydrochloric acid comes in contact with potassium permanganate, what dangerous chemical is released?
One time for the entire number set : You must run your program one time for the entire number set. Test for EOF (or use the function feof()) to know when to stop processing. You are to determine if each integer read is prime or not, and output the result to stdout
Smallest exponent that can be stored using this 16 bit stand : storing number in a string of 16 bits, the first bit is used for the sign of the number, and the next 5 bits store the exponent plus the bias, and the remaining 10 bits store the mantissa.  The bias is 15. What is the smallest exponent that can be st..
Determine the theoretical yield of the nacl product : The NaHCO3 is the limiting reactant and the HCl is the excess reactant in this experiment. Determine the theoretical yield of the NaCl product.
Calculate the average density of the star : A star is estimated to have a mass of 1 multiplied by 1036 kg. Assuming it to be a sphere of average radius 6.5 multiplied by 105 km, calculate the average density of the star in units of grams per cubic centimeter.
Create a system of equations : Create a system of equations that includes one linear equation and one quadratic equation and create a rational equation that has an extraneous solution.

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