The flow of the program is this:
Computer prints out "Hello and Welcome to Mars++'s addition calculator."
The computer asks for first and second number.
If the second Number is 0. Then the computer is to exit the program.
If the second Number is anything else besides 0. Then the program continues on the loop and asks you to input another first number.
- Code: Select all
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
double firstNumber, secondNumber;
cout << "Welcome to Mars++'s Basic addition Calculator!" << endl;
for(;;)
{
cout << "Enter First Number: ";
cin >> firstNumber;
cout << "Enter second Number(0 to Exit): ";
cin >> secondNumber;
if (secondNumber = 0)
{
cout << "Exiting" << endl;
break;
}
cout << "Those two numbers added up is: " << firstNumber + secondNumber << endl;
cout << endl;
}
return 0;
}
When you figure out what is wrong with the code. Create a new code that works, and tell what you changed to make it work. The program's objective should not change.

