Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that reads the integers in the text file integers.dat and: Displays the number of integers in the file Displays the number of

Write a program that reads the integers in the text file integers.dat and:

Displays the number of integers in the file

Displays the number of even and odd integers

Displays the sum of the even integers and the sum of the odd integers as well as the sum of all the integers

Displays the largest integer and the smallest integer

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:

123 475 61 77 910

234 138 134 95 674

345 31 211 952 873

22 7 876 347 450

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 in the file is 20

There are 11 odd integers and 9 even integers

The sum of the odd integers is 2645

The sum of the even integers is 4390

The sum of all the integers is 7035

The largest integer is 952

The smallest integer is 7

The average of 952 and 7 is 479.5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

Students also viewed these Databases questions

Question

LO5 Illustrate the steps in developing a base pay system.

Answered: 1 week ago

Question

LO3 Outline strategic compensation decisions.

Answered: 1 week ago