Question

Convert the following pseudocode into C++ language. Declare X, Y, Z As Integer For (X =...

Convert the following pseudocode into C++ language.

Declare X, Y, Z As Integer

For (X = 1; X < 4; X++)

Write “Pass Number “ + X

For (Y = 1; Y < 10; Y+3)

Set Z = X + Y

Write X + “ + “ + Y + “ = “+ Z

End For(Y)

End For(X)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1 #include <iostream> 2 3 using namespace std; 4 5- int main() { 6 int X, Y, Z; 7 for (x = 1; X < 4; X++) { 9 cout << Pass N

#include <iostream>

using namespace std;

int main() {
int X, Y, Z;
for (X = 1; X < 4; X++)
{
cout << "Pass Number " << X << endl;
for (Y = 1; Y < 10; Y = Y+3)
{
Z = X + Y;
cout << X << " + " << Y << " = " << Z << endl;
}
}
}

// Please up vote

Add a comment
Know the answer?
Add Answer to:
Convert the following pseudocode into C++ language. Declare X, Y, Z As Integer For (X =...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • What is wrong with the following pseudocode? Declare Count As Integer Declare TheNumber As Integer Set...

    What is wrong with the following pseudocode? Declare Count As Integer Declare TheNumber As Integer Set TheNumber = 12 For (Count = 10; Count>TheNumber; Count--) Write TheNumber + Count End For A) The limit condition in a For loop cannot be a variable B) The loop will never be entered since the initial value of Count is less than the test condition C) The loop will never end since the test condition will never be met D) A counter must...

  • In the pseudocode below: Function Integer perfect(Integer n) Declare Integer count = 0 Declare Integer sum...

    In the pseudocode below: Function Integer perfect(Integer n) Declare Integer count = 0 Declare Integer sum = 0 While count < n Set count = count + 1 Set sum = sum + count End While Return sum End Function Function Integer perfect_sum(Integer n) Declare Integer count = 0 Declare Integer sum = 0 While count < n Set count = count + 1 Set sum = sum + perfect(count) End While Return sum End Function Module main() Display perfect_sum(5)...

  • What will the following pseudocode program display

    What will the following pseudocode program display? Module main( ) Declare Integer x = 1 Declare Real y = 3.4 Display x, " ", y Call changeUs(x, y) Display x, " ", y End Module Module changeUs(Integer a, Real b) { Set a = 0 Set b = 0 Display a, " ", b }

  • Consider the following pseudocode Xinteger procedure set x(n global integer) Xin procedure print x write integer(x)...

    Consider the following pseudocode Xinteger procedure set x(n global integer) Xin procedure print x write integer(x) procedure first set x(1) print x procedure second xinteger set x(2) print x set x(e) first() print x second print x What does this program print if the language uses static scoping? What does it print with dynamic scoping? Why?

  • I am supposed to a pseudocode function named max that accepts two integer values as arguments...

    I am supposed to a pseudocode function named max that accepts two integer values as arguments and returns the value that is greater of the two. Use the function in a program that prompts the user to enter two integer values. The program should display the value that is greater of the two. Is everything correct and complete? //Pseudocode //This function takes two integers as parameters: x and y Begin : Max(x,y) If(x>y) then MAX=x Else MAX=y End if Return...

  • the coding language is just the basic c language and here is my first attempt at...

    the coding language is just the basic c language and here is my first attempt at this problem my problem is that if the user inputs a number that is equal to a number that has been entered previously the code will never end until the user enters a number that is bigger than any other number previously entered any help will be helpful Write a program to read-in a sequence of integers from the keyboard using scanf(). Your program...

  • IN C 4) Convert the following mathematical formula to a C code, where Z, a, b...

    IN C 4) Convert the following mathematical formula to a C code, where Z, a, b and c are doubles (You do not need to write the whole program, just write the code fragment) Z-a + sqrt(b+3 5-2)/(c 5)*3 mod 5 5) Write a program that prompts the user to enter an integer number (N) and then displays the following (2N+1)-by-(2N+1) pattern like the one below Enter a number: 4

  • Convert the following assembly language program into a C program: *Update: The variables are initialized, in...

    Convert the following assembly language program into a C program: *Update: The variables are initialized, in lines 4 & 6 of the red assembly language code. Convert the following assembly language program into a C program: *Update: The variables are initialized, in lines 4 & 6 of the red assembly language code. include "p24Hxxxx.inc" global__reset bss: Uninitialized data section: Variables start at location 0x0800 x: .space 2: Allocating space (two bytes) to variable. y: .space 2;Allocating space (two bytes) to...

  • 1. Convert the following C statement to MIPS code. Assume x, y and z are assigned...

    1. Convert the following C statement to MIPS code. Assume x, y and z are assigned to registers $s0, $s1 and $s2 respectively and the starting address of array A is $s6. x = y + z + A[3] 2. 2.Convert the following C statement to MIPS code. Assume the base address of array A is $s3 and h is assigned to register $s2 . A[7] = h + A[7]

  • 1. declare two integer variables x and y and two pointers to p and q. initialize...

    1. declare two integer variables x and y and two pointers to p and q. initialize the value of x with 2, y with 8 and the pointer p should point to the address of x and q should point to the address of y. 2. then write a C statements that will print the following information: a. the address of x and the value of y. b. the value of p and the value of *p. c. the address...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT