85.0k views
1 vote
Create an algorithm and flowchart that will accept NUM1 and NUM2 and compute the following:

A) SUM (+)
B) DIFFERENCE (-)
C) PRODUCT (*)
D) QUOTIENT (/)
E) MODULO (%)

1 Answer

4 votes

Final answer:

To compute the SUM, DIFFERENCE, PRODUCT, QUOTIENT, and MODULO of two numbers, you can follow a step-by-step algorithm and create a flowchart.

Step-by-step explanation:

To create an algorithm and flowchart that will accept NUM1 and NUM2 and compute the SUM, DIFFERENCE, PRODUCT, QUOTIENT, and MODULO, you can follow these steps:

  1. Start by accepting the values of NUM1 and NUM2 as input.
  2. Compute the SUM by adding NUM1 and NUM2 together.
  3. Compute the DIFFERENCE by subtracting NUM2 from NUM1.
  4. Compute the PRODUCT by multiplying NUM1 and NUM2 together.
  5. Compute the QUOTIENT by dividing NUM1 by NUM2.
  6. Compute the MODULO by finding the remainder when NUM1 is divided by NUM2.
  7. Display the results of the SUM, DIFFERENCE, PRODUCT, QUOTIENT, and MODULO.
  8. End the algorithm.

A flowchart can be created to visually represent these steps and help with understanding the algorithm.

User Hassan Jalil
by
7.9k points