Explore BrainMass

Explore BrainMass

    Implementing a pseudocode m-file function with two inputs

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Convert the following structure plan into a function m-file with two inputs (M and N):

    Get M and N values
    if M does not equal round(M)
    Give error message that inputs must be integers
    end if
    if N does not equal round(N)
    Give error message that inputs must be integers
    end if
    while remainder of M divided by N is not zero
    Set R to the remainder of M divided by N
    Set M to be N
    Set N to be R
    end while
    Return final value of N as output

    © BrainMass Inc. brainmass.com June 7, 2023, 2:49 pm ad1c9bdddf
    https://brainmass.com/computer-science/matlab/implementing-pseudocode-mfile-function-inputs-26635

    Solution Preview

    function result=twonumbers(m,n)
    %to run the program, type twonumbers(m,n) where m and n are ...

    Solution Summary

    Help to convert the following structure plan into a function m-file with two inputs (M and N) is given.

    $2.49

    Free BrainMass Quizzes

    • Basic Computer Terms

      We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

    • Basic UNIX commands

      Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

    • Excel Introductory Quiz

      This quiz tests your knowledge of basics of MS-Excel.

    • C++ Operators

      This quiz tests a student's knowledge about C++ operators.

    • Java loops

      This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

    View More Free Quizzes