Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93087517

Have any Question?


Related Questions in Computer Engineering

At a seaside resort where the temperature is 25degc a child

At a seaside resort where the temperature is 25°C, a child holds a 1.5 L balloon. Her grip on the balloon loosens and it sails upward for 4.5 miles. If the atmosphere is 340 torr and the temperature is -18°C, what is the ...

A mixture of 499 mol of n2 and 3090 g of no is heated in a

A mixture of 4.99 mol of N2 and 30.90 g of NO is heated in a closed vessel to 2000 °C. After heating, the total pressure of the mixture at equilibrium is 3.14 atm. N2(g) + O2(g) 2NO(g) Kp= .101 at 2000 C In which directi ...

Question research parallel computing and prepare an

Question : Research parallel computing and prepare an informal paper 2 -3 pages in length, single spaced with a blank line beltween paragraphs. The response must be typed, single spaced, must be in times new roman font ( ...

Find minimal dfas for the following languages in each case

Find minimal dfa's for the following languages. In each case prove that the result is minimal. (1) L = {a n bm> :n≥2,m≥1}. (2)L = {a n :n ≥ 0,n ≠ 3} (3) L = {a n :n mod 3 = 0}∪{a n : n mod 5 = 1}

Small business e-commerce portals check out small business

Small Business e-Commerce Portals Check out Small Business Center and the other e-commerce portals mentioned. Then answer the questions. Note: Small Business Center and Entrabase.com are interesting sites that offer a wi ...

C programminghelp with a program positivec that include the

***C PROGRAMMING*** Help with a program positive.c that include the following function: void extract(int *a, int n, int *positive, int *size); The function should use pointer arithmetic, not subscripting. The extract fun ...

Question suppose a prolog database exists that gives

Question : Suppose a Prolog database exists that gives information about the parts in an automobile engine. Predicates of big, small, and part-of are included. a. Write a query to find all small items that are part of ot ...

Question suppose 4 packets of a message each of l bits

Question : Suppose 4 packets of a message, each of L bits arrive at a switch (router) and traverse a link with rate R bps to the destination. Further, suppose that the link is free when the first packet arrives, and the ...

Develop a hypothesis that could explain why a soap created

Develop a hypothesis that could explain why a soap created from the acid CH 3 CH 2 CH 2 CH 2 COOH has poorer cleaning properties than soap made from palmitic acid. Develop a hypothesis that could explain why a soap creat ...

What is the various security architectures which provides

What is the various security architectures. Which provides the best balance between simplicity and security? Justify your answer.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As