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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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