Final answer:
To write a C++ program that calculates and displays the result of multiplication using the ancient method described, you should use if statements and loops. Validate the input values to make sure they are both positive. Use a while loop to multiply X by 2 and divide Y by 2 until Y becomes zero. Display the result of the multiplication.
Step-by-step explanation:
To write a C++ program that calculates and displays the result of multiplication using the ancient method described, you should use if statements and loops. First, prompt the user to enter two positive integers. Validate the input values to make sure they are both positive. Use a loop to repeatedly ask the user to reenter each number until they enter a positive integer. Then, use a while loop to multiply X by 2 and divide Y by 2 until Y becomes zero. Keep track of the sum of X whenever Y was odd. Finally, display the result of the multiplication.