Ask Question
5 November, 19:54

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

+3
Answers (1)
  1. 5 November, 23:18
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers