Question
Please I need help ASAP in C++ Your task is to create a program that implements the division algorithm (algorithm 4.8.1, page 219 of the
Please I need help ASAP in C++
Your task is to create a program that implements the division algorithm (algorithm 4.8.1, page 219 of the textbook) and the Euclidean algorithm (algorithm 4.8.2, page 224 of the textbook) and accepts positive integer input between 1 and 2^63, i.e. the "long long" data type. You should submit a single source code file named main.cpp that contains all of the C++ code required to complete this assignment.
Instructions: Given two integers x and y with the requirements that 1 <= x <= 2^63 AND 1 <= y < x, Create a C++ program that prompts the user for the two values, and then displays the following: The greatest common divisor of x and y, i.e. gcd(x,y), calculated using the Euclidean algorithm (4.8.2) The quotient q and remainder r that satisfy the equation x = yq + r, calculated using the Division algorithm (4.8.1). Note that 0 = r < y by the definition of "remainder". Please have it run 4 times and respond appropriately (but not end) if an incorrect input is given.
Your code must implement and use the algorithms given in the textbook. You may use functions provided by System::Numerics or GNU GMP to test and verify your answers, but the algorithms must be implemented and used in your code, and not have your program simply call a built-in library function to get the answer.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started