Ask Question
9 November, 03:51

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. 9 November, 03:53
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers