IntegerLoop

Download Category:

IntegerLoop.zip - (534.05 KB)
[
IntegerLoop/Debug/
IntegerLoop/Debug/cl.command.1.tlog
IntegerLoop/Debug/CL.read.1.tlog
IntegerLoop/Debug/CL.write.1.tlog
IntegerLoop/Debug/IntegerLoop.exe
IntegerLoop/Debug/IntegerLoop.exe.embed.manifest
IntegerLoop/Debug/IntegerLoop.exe.embed.manifest.res
IntegerLoop/Debug/IntegerLoop.exe.intermediate.manifest
IntegerLoop/Debug/IntegerLoop.ilk
IntegerLoop/Debug/IntegerLoop.lastbuildstate
IntegerLoop/Debug/IntegerLoop.log
IntegerLoop/Debug/IntegerLoop.obj
IntegerLoop/Debug/IntegerLoop.pdb
IntegerLoop/Debug/IntegerLoop.vcxprojResolveAssemblyReference.cache
IntegerLoop/Debug/IntegerLoop.write.1.tlog
IntegerLoop/Debug/IntegerLoop_manifest.rc
IntegerLoop/Debug/link.10160.read.1.tlog
IntegerLoop/Debug/link.10160.write.1.tlog
IntegerLoop/Debug/link.10160-cvtres.read.1.tlog
IntegerLoop/Debug/link.10160-cvtres.write.1.tlog
IntegerLoop/Debug/link.command.1.tlog
IntegerLoop/Debug/link.read.1.tlog
IntegerLoop/Debug/link.write.1.tlog
IntegerLoop/Debug/link-cvtres.read.1.tlog
IntegerLoop/Debug/link-cvtres.write.1.tlog
IntegerLoop/Debug/mt.command.1.tlog
IntegerLoop/Debug/mt.read.1.tlog
IntegerLoop/Debug/mt.write.1.tlog
IntegerLoop/Debug/rc.command.1.tlog
IntegerLoop/Debug/rc.read.1.tlog
IntegerLoop/Debug/rc.write.1.tlog
IntegerLoop/Debug/vc100.idb
IntegerLoop/Debug/vc100.pdb
IntegerLoop/IntegerLoop.cpp
IntegerLoop/IntegerLoop.sln
IntegerLoop/IntegerLoop.suo
IntegerLoop/IntegerLoop.vcxproj
IntegerLoop/IntegerLoop.vcxproj.filters
IntegerLoop/IntegerLoop.vcxproj.user
IntegerLoop/integers.dat
IntegerLoop/Question.txt
IntegerLoop/Screenshot_1.jpg
]

Write a program that reads two integers from the text file integers.dat. The first integer should be considered the low number and the second integer the high number. The program should loop through all integers between the low and high values. The loop should include the low and high integers.
1. Displays the number of integers in the file
2. Displays the number of integers divisible by 5 OR 6, but not both.
3. Displays the sum of the integers from condition 2 as well as the sum of all the integers
4. Displays the largest integer and the smallest integer that satisfy condition number 2.
5. Computes the average of the largest and smallest integer
Assume the contents of integers.dat (the file is being provided for you) are as follows:
100 200
The following is a sample output: User input in red
Welcome to Wake’s Integer processing Agency
What is name of the input file? integers.dat
The number of integers between the two numbers is 101
There are 32 integers that are divisible by 5 or 6 but not both
The sum of the integers that are divisible by 5 or 6 but not both is 4800
The sum of all the integers is 15150
The largest integer divisible by 5 or 6 but not both is 200
The smallest integer divisible by 5 or 6 but not both is 100
The average of 200 and 100 is 150
NOTE:
1.Use two decimal point precision for the average
2.To check your code, adjust one of the integers in the file, recompile your code and run again (suggest changing the largest and smallest integers)
3.Assume that the .dat can contain any two integers. The only constraint is that the first number is ***** than the second. Only use 100 and 200 for testing.

Write a Review

Get a fresh solution of this question. Ask it now to our experts.
doubt

Ask Your Question

We have verified professionals who are ready to answer your question.

time

Save Time and Money

We choose experts who can quickly answer your question and that suit your budget.

download

Get Your Answer

Your satisfaction is 100% guaranteed. You can keep on asking questions until you get the answer you need.