Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write code using only #include PART 1: OUT OF RANGE ERROR In C++, the fundamental type of int on the PACE-ICE system uses 32

Please write code using only #include

image text in transcribed

PART 1: OUT OF RANGE ERROR In C++, the fundamental type of int on the PACE-ICE system uses 32 bits to represent an integer; however, you can extend this to 64 bits by using another fundamental type in C++ called long int. (Please note that these sizes can vary from platform to platform and are not guaranteed in the C++ standard which we will talk about in class.) NOTE: On Windows/Visual Studio, an int is the same as a long int and you'll instead need to use long long int to get a 64bit integer. I would like for you to write a program to calculate the results of 5" for n 1,2, 3, 4,... using first the int type and then the long int type. Please empirically show the maximum value of n that can still store the results of 5" in an int, and long int variables without overflow. In addition to the main() function, to get practice using global functions, I would like for you to create four global functions to calculate the value of 5". These two global functions should have one argument that is an int n. The first should return an int, and the second should return a long int so that you can compare the ranges of these two data types. In your Labl folder, please call your source code lab1part1.cc. Sample output for this program up to 5 is shown below Please follow this output format; until one step past the maximum value 5 to the n power results using int 5 25 5'= 125 5 to the n power results using long int 5 25 5 125

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

Step: 3

blur-text-image

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 3 Lnai 6323

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

3642159389, 978-3642159381

More Books

Students also viewed these Databases questions

Question

=+/ Review of organizational literature/information

Answered: 1 week ago

Question

Discuss the techniques of job analysis.

Answered: 1 week ago

Question

How do we do subnetting in IPv6?Explain with a suitable example.

Answered: 1 week ago

Question

Explain the guideline for job description.

Answered: 1 week ago

Question

What is job description ? State the uses of job description.

Answered: 1 week ago

Question

What are the objectives of job evaluation ?

Answered: 1 week ago