C++ program that reads in two positive integers

Assignment Help C/C++ Programming
Reference no: EM13936948

Write a C++ program that reads in two positive integers that are 20 or fewer digits in length and outputs the sum of the two numbers.

Your program will read the digits as values of type char so that the number 1234 is read as four characters '1', '2', '3' and '4'. After they are read into the program, the characters are changed to values of type int. The digits will be read into a partially filled array and you might find it useful to reverse the order of the elements in the array after array is filled with data from the keyboard.

Your program will perform the addition by implementing the usual pencil and paper addition algorithm. The result of the addition is stored in an array of size 20 and the result is written to screen. if the result of the addition is an integer with more
than maximum number of digits(that is more than 20 digits) then your program should issue a message saying that it has encountered "integer overflow".

You should be able to change the maximum length of the integers by changing only one globally defined constant. Include the loop that allows the user to continue to do more additions until the user says the program should end.

What I have written so far, is attached as project13.cpp . The problem that I am having is, after the two numbers are input they are not being added. This program will compile so you can check it out.

Attachment:- addlargeintegers.zip

Reference no: EM13936948

Questions Cloud

What data will you use in your empirical work : What data will you use in your empirical work? What is the source of your data? Why is this particular data set appropriate for the study
Concepts used to explain consumer behaviors in 21st century : "How do changes in technological, economic life, and the change of people's life style, has an effect over the concepts and the approches that are used to explain consumer behaviors in 21st century? Examine in terms of the consumer behavior theory..
Observe that most of the salamanders are blue : Assuming that all of the salamanders are descended from an ancestral yellow salamander, where did the other colors come from? (think about the origin of all change)
Prepare a balanced scorecard : You are asked to prepare a Balanced Scorecard using either Option 1, 2 or 3.In doing this Balanced Scorecard you are required to provide for each of the Four Perspectives of the Balanced Scorecard at least One Objective,and two Performance Indicat..
C++ program that reads in two positive integers : Write a C++ program that reads in two positive integers that are 20 or fewer digits in length and outputs the sum of the two numbers.
Stages of the consumer purchase decision process : Social influences impact product and brand purchase decision at all stages of the consumer purchase decision process. You are required to identify at least two social influences that are relevant to the consumers of your firm or the firm you inten..
Operations and information management : Operations and Information Management Operations and Information Management Semester 1, 2014-2015 Information Management Assignment: Sky High Airlines Report This is an individual assignment worth 50% of the module mark. Word length 2000 - 2500 wo..
How household decisions to go on holidays : Task: Write a report demonstrating how household decisions to go on holidays are influenced by their stage in the household lifecycle.
What are benefits of improving quality at mixing operation : What are the benefits of improving quality at the mixing operation compared with the benefits of improving quality at the tablet-making operation?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Implementnbsp the lsquoguess the word game in an

implementnbsp the lsquoguess the word game in an object-oriented manner. this program would add some basic manipulation

  Questions of mcqs in c programming

The quality of a language that allows a programmer to express a computation clearly, correctly, concisely, and quickly is called _____.

  Implement a class timedepositaccount

It is not possible to deposit additional funds into this account. Provide a withdraw method that removes the entire balance. Partial withdrawals are not allowed.

  Applications presenting room booking

Write a windows applications presenting room booking. Add XML serialization to the application.Define a class Room that contains private information for the name, the size, the number of people than it can hold, booked/free, and the name of booker..

  Create a program with just one function

Create a program with just one function that uses the selection sort to sort a linked list IN C++

  Write program that print a diamond shape featuring asterisk

For this assignment, we will need to write a c++ program that is print out a diamond shape featuring the * asterisk to the console window. Please submit .cpp file.

  Input the two integer numbers in the subroutine

Let the user to input the two integer numbers in the subroutine, then do the subsequent math and show the result in the main function.

  Program in c to ask the user to input a set of characters

Write a program in C++ to ask the user to input a set of characters, one at a time separated by the carriage return (Enter). Each character, as well as, its corresponding ASCII value should be stored in a linked list node. This means that each nod..

  Write one input function to input one number

Write one input function to input one number, returning that value via the return statement to the calling function. You will need to call this function 4 times to get all 4 values

  Problem 1greatest common divisor write code for a recursive

problem 1greatest common divisor write code for a recursive implementation of euclids algorithm for searching the

  Write a function which adds the two numbers

In C write a function which adds the two numbers. Test this function by calling from the main. In main, the user should be asked to provide the two numbers.

  What mechanism allows the overloaded subscript operator

What mechanism allows the overloaded subscript operator [] to be used on the left side of an assignment statement, like this: v[2] = 22?

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