Below is a simple C++ program that fulfills the requirements of the assignment.
#include <iostream>
const int numDigits = 20;
// Function to right-justify a char array by shifting to the right
void rightJustify(char arr[], int length) {
for (int i = length - 1; i > 0; --i) {
arr[i] = arr[i - 1];
}
arr[0] = '0'; // Fill the leftmost digit with '0'
}
// Function to add two char arrays representing decimal numbers
void addDecimal(char balance[], char deposit[]) {
int carry = 0;
for (int i = numDigits - 1; i >= 0; --i) {
int digitSum = (balance[i] - '0') + (deposit[i] - '0') + carry;
balance[i] = (digitSum % 10) + '0';
carry = digitSum / 10
// Display the result
std::cout << "New Balance: " << balance << std::endl;
return 0;