Displays the number of integers in the file

Assignment Help Computer Engineering
Reference no: EM132211347

Question :

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.

Displays the number of integers in the file

Displays the number of integers divisible by 5 OR 6, but not both.

Displays the sum of the integers from condition 2 as well as the sum of all the integers

Displays the largest integer and the smallest integer that satisfy condition number 2.

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:

Use two decimal point precision for the average

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)

Assume that the .dat can contain any two integers. The only constraint is that the first number is less than the second. Only use 100 and 200 for testing.

Reference no: EM132211347

Questions Cloud

What do you know about the certainty equivalent : A young couple has $30,000 (95% of their savings) to invest in either savings bonds or a real estate deal. The (zero coupon) savings bonds return $36,000.
HR have with organization-wide ethics initiatives : What day-to-day challenges do line-manager face relative to HR-related ethical issues? What involvement should HR have with organization-wide ethics initiatives
Write a program that reads in integers between 1 and 100 : Write a program that reads in integers between 1 and 100, which are separated by a space in one line, and counts the occurrences of each integer.
Describe and explain the concept of map scale : Please respond thoughtfully and completely to the following questions. Why can't a map represent Earth's surface as accurately as a globe?
Displays the number of integers in the file : The program should loop through all integers between the low and high values. The loop should include the low and high integers.
What motivates company to develop cross-border alliance : What motivates a company to develop a cross-border alliance?
Find the correct value of coefficient of rank correlation : The coefficient of correlation of 12 pairs of observation was found to be 0.62 It was later discovered that the value of difference between the ranks.
What are main advantages and disadvantages of diversity : What are the main advantages and disadvantages of diversity and how can you optimize them? How diverse is your team? Be specific
Write a program that reads a set of floating-point values : Write a program that reads a set of floating-point values. Ask the user to enter the values (prompting only a single time for the values), then print.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Preventing the pci specifications

To prevent having the whole network subject to the PCI specifications, how would you segment the network in order to decrease the scope of compliance?

  What was the starting state

The circuit shown below gave an output sequence of Z = 11011111 for an input sequence X = 01101010. What was the starting state?

  Identify the elementary operation

Identify the elementary operation. Compute how many times the elementary operation is executed with respect to the input size n.

  It will cost 65000 to implement the project all of which

a four-year financial project has estimates of net cash flows shown in the following tableyear net cash

  Write a script using vim editor

Write a script using vim editor. The script should display the path to your homedirectory and the terminal type that you are using.

  List all of the fire accident classification classes

List all of the fire accident classification classes. Find at least three different fire extinguishers (do not touch them) and document their location.

  Find out the error in the recursive method

Find out the error in the recursive method.

  What types of memory will you use and why

What types of memory will you use and why? In the example of a music-streaming device, we can use cache memory to store temporary song as they are being played.

  Why does the source of a cpp template function need

Why does the source of a C++ template function need to be available to be able to compile the client code? Is this necessary for an Ada generic function?

  Suppose that you are a cio of a startup company the company

imagine you are starting a web business and want to incorporate cloud technology. describe how you would

  Progarm converts a number from roman numerals to decimal

Write down a program that converts a number from Roman numerals to decimal. It needs to consist of a class, romanType.

  Information systems project

Information Systems Project

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