Computes the average of the largest and smallest integer

Assignment Help Computer Engineering
Reference no: EM132100047

Please read this lab exercise thoroughly, before attempting to write the program.

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: EM132100047

Questions Cloud

Is mrsa a eukaryotic or prokaryotic structure : Is MRSA a eukaryotic or prokaryotic structure?
Create a mobile application that allows customers : Create a mobile application that allows customers to reserve tables at local restaurants.
What would transpire when a character utilizing the fes : What would transpire when a character utilizing the FES/NMES electrotherapy device accidentally puts it to full impulse?
Directional selection and disruptive selection : What is the distinction between Directional Selection And Disruptive Selection?
Computes the average of the largest and smallest integer : Displays the largest integer and the smallest integer that satisfy condition number 2. Computes the average of the largest and smallest integer
Anatomy of muscle contraction : In need of assistance with this. With an ATP utilization emphasis, what is the normal physiology/anatomy of muscle contraction?
Dna fragments on a gel in the process of electrophoresis : What is the force that is used to seperate DNA fragments on a gel in the process of electrophoresis?
List ways in which the mainframe of today challenges : List ways in which the mainframe of today challenges the traditional thinking about centralized computing versus distributed computing.
Difference between dependent and independent variables : What is the difference between dependent and independent variables? I am truly having a problem finding the difference between the two.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Build a program that schedules simulated CPU jobs

Build a program that schedules simulated CPU jobs. Your program should run in a loop, each iteration of which corresponds to a time slice for the CPU.

  What is the time complexity

What is the output when n = 2, n = 4, and n = 6? What is the time complexity T(n)? You may assume that the input n is divisible by 2.

  Decreasing risk of malicious attacks

While a large percentage of the information technology security budgets is devoted to decreasing the risk of malicious attacks, there exist other ways in which systems or data become damaged.

  Find the optimal value

Find the optimal value w* for which E(w) reaches its minimum value, and give this minimum cost - These two weights should converge to the optimal values as you will give in (a).

  Design alternatives have to be thoroughly considered

Design alternatives have to be thoroughly considered. There must be a process to fairly evaluate the pros and cons of each option. Let's look at how the alternative matrix can help facilitate the design decision through creation of our own alterna..

  Explain the conditions that have to be in place for overflow

Explain the conditions that have to be in place for an overflow to occur after an integer addition operation.

  Determine the size of such an application

Complete a function point worksheet to determine the size of such an application. You will need to make some assumptions about the application's interfaces and the various factors that affect its complexity.

  How dependency notation can be used

Explain how dependency notation can be used to describe complicated switching circuits.

  What protocol is used by computer connections to internet

What protocol is used by all computer connections to the Internet? What is the form of an IP address? Describe a fully qualified domain name.

  Preliminary design model, and a logical model of the system

Can you advise me on what a Preliminary Design Model, and a Logical Model of the System are. Can you please point me or show me examples of these two models.

  Define physical plant operations

A fully configured computer facility, with all information resources and services, communication links, and physical plant operations

  Create an application that produces three different outputs

Create an application that produces three different outputs using the same phrase. Select your own favorite popular saying for the phrase.

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