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)

#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
Convert the following pseudocode into C++ language. Declare X, Y, Z As Integer For (X =...
Please select the output: main declare X as integer, Y as integer set x=1 set y=2 call sub(x, y) write x write y End program Subprogram sub( integer Num1 as ref, Integer Mum2 as reference) declare x as integer set Num1 = 3 set Num2 = 4 set x= 5 write x end subprogram Please select one: 5/42, 5/34, 5/32, 5/24 What is the output of this...
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 = 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? 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) 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?
CONCEPTS OF PROGRAMMING LANGUAGE Consider the following program skeleton Procedure Main is X, Y, Z: Integer; procedure Sub1 is A, Y, Z: Integer; begin -- of Sub1 ... end; -- of Sub1 procedure Sub2 is A, B, Z: Integer; begin -- of Sub2 ... end; -- of Sub2 procedure Sub3 is A, X, W: Integer; begin -- of Sub3 ... end; -- of Sub3 begin - of Main ... end; -- of Main Given the following calling sequences and assuming...
How many times will the Write statement be executed based on the following pseudocode? Declare HelloCount As Integer Set HelloCount = 1 Repeat Repeat Write "Hello" Set HelloCount = HelloCount + 1 Until HelloCount <=1 Until HelloCount == 2
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 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 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