Ask Question
16 November, 07:36

Convert the following pseudi code to C+ + code. BE sure to define the apprpriat evariables.

a. Store 20 in the speed varaible.

b. Store 10 in the time variable.

c. Multiply speed by time and store the result in the distance variable

d. Display the contents of the distance variable

+2
Answers (1)
  1. 16 November, 10:21
    0
    Following are the C+ + code

    int speed=20; / / Store 20 in the speed varaible.

    int time=10; / /Store 10 in the time variable.

    int distance = speed * time; / / multiply by speed * time

    cout<
    Explanation:

    Following are the program in C+ + language:

    #include / / header file

    using namespace std; / / namespace

    int main ()

    {

    int speed=20; / / Store 20 in the speed varaible.

    int time=10; / /Store 10 in the time variable.

    int distance = speed * time; / / multiply by speed * time

    cout<
    return 0;

    }

    Output:20

    Explanation:

    Following are explanation of following code

    Declared a vaiable of type int called "speed" and store 20 on it. Declared a vaiable of type int called "time" and store 10 on it. multiply by speed into the time and store into the distance variable. finally print the "display" value
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Convert the following pseudi code to C+ + code. BE sure to define the apprpriat evariables. a. Store 20 in the speed varaible. b. Store 10 ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers