1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nataly_w [17]
2 years ago
14

Write a simple program that takes in a numerator and denominator and then computes the GCD for that fraction. You can assume tha

t there is a GCD for any fraction entered. Once you have found the GCD, print the original fraction and the fraction reduced with the GCD to the command line. To get full credit for this assignment, you must use iteration. java
Computers and Technology
1 answer:
Marizza181 [45]2 years ago
3 0

A simple program that takes in a numerator and denominator and then computes the GCD for that fraction is Enter your and then Enter your denominator: zero Invalid input, denominator can't be zero.

<h3>What is numerator and denominator in programming?</h3>
  1. Enter your denominator: zero Invalid input, denominator can't be zero.
  2. Enter your denominator: 3
  3. The lowest phrases of your fraction: 34/3
  4. Enter your denominator: 6.
  5. The lowest phrases of your fraction: 1/2
  6. ++ Code

  1. # include
  2. # include
  3. the use of namespace std;
  4. // Function to calculate GCD
  5. int g_c_d(int num1, int num2)
  6. go back num2;
  7.   if (num2 == 0)
  8. go back num1 if (num1 == num2)
  9. go back num1;
  10. // Function to lessen to fraction to lowest phrases
  11. bool to_lowest_terms(int &numerator, int &denominator)
  12. {
  13. if (denominator == 0)
  14.   if (numerator == 0)
  15.  cout << "nThe lowest phrases of your fraction: " << 0 xss=removed> 0 && denominator > 0);
  16. numerator = abs(numerator);
  17. denominator = abs(denominator);
  18. int factor = g_c_d(numerator, denominator)

Read more about GCD :

brainly.com/question/219464

#SPJ1

You might be interested in
Assume that you are able to do an exhaustive search for the key to an encrypted message at the rate of 100 Million trials per se
Len [333]

Answer:

Following are the solution to this question:

Explanation:

In point 1:

Trials frequency = \frac{100 \  million }{second}

calculating the main length of cryptography = 112 bit

\to 100\  Million = 1 \times 10^8

calculating the second year value:

\to 365 \times 24 \times 60 \times 60 =3153600\\\\

                                  =3.15 \times 10^7 \ seconds

Currently, in average , at least half the possible sleeves is being used to verify the encryption process:  2^{111} \ keys

\to \frac{2^{111} \time3s 10^6}{3.15 \times 10^7}\approx 8.22 \times 10^{20} \ years

the total time value will be 8.22 \times 10^{20} \ years

In point 2:

In cryptography, the common name is Triple DES (3DES), which would be the symmetric-key encrypted communication algorithm (TDEAor Triple DEA), which adds 3 times per block size only with the cryptographic method Data Encryption Standard ( DES).  

Algorithm:-

The key package involves four DES keys, K1, K2, and K3, each 56-bit (except parity bits), Triple DES includes. Its encoding algorithm is::  

ciphertext = EK3(DK2(EK1(plaintext)))

I.e. K1, DES encrypt, K2 decrypt, then K3 encrypt DES.  

The reverse is the decryption:  

plaintext = DK1(EK2(DK3(ciphertext)))

I.e. decrypt by K3, crypt by K2, decrypt by K1.  

Every three-bit authentication encrypts a 64-bit block.

Its middle procedure in each situation it's the reverse of the first operation. It improves the strength of the key second option algorithm which offers DES native support with key option 3.

4 0
3 years ago
Oliver’s night job at the university computing center is to change the tapes used for overnight data backups on the server. Whil
densk [106]

Answer:

Explanation:

Ollie’s thesis may not be backed up as reliably as he might wish. A backup program may pass over a file that is currently open for writing, as the state of the data in such a file may be indeterminate.

4 0
3 years ago
Which task, performed by systems developers, will most likely ensure that end users accept a new system?
aalyn [17]
I would say "beta testing" helps to make sure users will accept a system.
6 0
4 years ago
What is this computer​
Salsk061 [2.6K]

Answer:

A Macintosh

Explanation:

6 0
3 years ago
A ____ web site is a fraudulent site that has been set up to be indistinguishable from the legitimate site it is pretending to b
Vladimir [108]
Your answer is spoofed.
Thx and take care
7 0
3 years ago
Other questions:
  • Jesse is writing a physics quiz about the motion of a roller coaster cart. He has a clip art illustration of a cart rolling hori
    9·2 answers
  • A friend of yours is having trouble getting good Internet service. He says his house is too remote for cable TV—he doesn’t even
    11·1 answer
  • A(n _______________ is a pre-written formula that is built into excel
    12·1 answer
  • The term BIOS stands for
    6·1 answer
  • You have just made changes to a GPO that you want to take effect as soon as possible on several user and computer accounts in th
    7·1 answer
  • In the Word 2016 window, where is the Status bar located?
    8·1 answer
  • Mobile cameras are now of a higher quality than when they first arrived on the market. Describe the difference in
    5·1 answer
  • What is the output of the following C++ code? int list[5] = {0, 5, 10, 15, 20}; int j; for (j = 0; j &lt; 5; j++) cout &lt;&lt;
    11·1 answer
  • Polynomial regression A common misconception is that linear regression can only be used to fit a linear relationship. We can fit
    11·1 answer
  • Give the value of the zero flag, the carry flag, the signflag, and the overflow flag after each of the following instructions if
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!