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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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