Login

Contact Us
Programming
Programming Questions? Ask a Programmer for Answers ASAP
Not a Programming Question?
How JustAnswer Works:
Ask an Expert
Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
Get a Professional Answer
Via email, text message, or notification as you wait on our site.
Ask follow up questions if you need to.
100% Satisfaction Guarantee
Rate the answer you receive.
Ask jeff Your Own Question
jeff
,
Computer Software Engineer
Category:
Programming
Satisfied Customers:
153
Experience:
7 yrs. of professional programming experience. BS and MS in Computer Science.
31939911
Type Your Programming Question Here...
jeff is online now
1)Suppose w, x, y and z are integer variables and initialized
This answer was rated:
★
★
★
★
★
1)Suppose w, x, y and z are integer variables and initialized as follows:
w = 2; x = 3; y = 4; z = 5;
In a block of C/C++/Java code, the following statements are executed. What is the value of w after these statements are executed?
{
x = z + y;
y = 2 * x  y;
w= x + w / 2  z
}
2)With x = 5 and y = 8 and z = 5, what is the value of the variable z after the execution of the
following pseudocode:
If ((x = 10)) Then
z = z + 1
Else
z = z – 1
End If
3)Let X = 3 and Y = 6. Indicate by entering T or F whether the expression is TRUE or FALSE
NOT(X > 3) AND NOT(Y < X)
4)Write pseudocode to print the numbers 3, 6, 9, 12, 15, 18 and 21 using a forloop
5) ) Using pseudocode declare a Real number named temperature
6)Using pseudocode declare a variable to store the Julian day (1366) named JDay.
This is only 6 questions out of 100 on my review sheet for my mid term! Please help as I am soo stuck on these! Thanks
Share this conversation
Expert:
jeff
replied 6 years ago.
1) Suppose w, x, y and z are integer variables and initialized as follows:
w = 2; x = 3; y = 4; z = 5;
In a block of C/C++/Java code, the following statements are executed.
What is the value of w after these statements are executed?
{
x = z + y;
y = 2 * x  y;
w= x + w / 2  z
}
Satement 1: x = z + y
x = 5 + 4 = 9
Statement 2: y = 2 * x  y
Remember that x was set to 9 in Statement 1
y = 2 * 9  4 = 14
Statement 3: After w = x + w/2  z is executed
w = 9 + 2/2  5 = 5
w = 5 is the final answer
2)
With x = 5 and y = 8 and z = 5, what is the value of the variable z after the execution of the following pseudocode:
If ((x <= 20) && (y >= 10)) Then
z = z + 1
Else
z = z – 1
End If
The first statement checks if x is less than or equal to 20 AND if y is greater than or equal to 10. The first condition evaluates to true, but the second condition evaluates to false since y is less than 10. Therefore, the entire if statement evaluates to false, and the statement after the Else is executed.
z = z  1 = 5  1 = 4
z = 4 is the final answer
3)Let X = 3 and Y = 6.
Indicate by entering T or F whether the expression is TRUE or FALSE NOT(X > 3) AND NOT(Y < X)
Let's break it down into parts:
(X > 3) = FALSE
NOT (X > 3) = TRUE
(Y < X) = (6 < 3) = FALSE
NOT(Y < X) = TRUE
Putting the two together
NOT(X > 3) AND NOT(Y < X) = TRUE AND TRUE = TRUE
TRUE is the final answer
4) Write pseudocode to print the numbers 3, 6, 9, 12, 15, 18 and 21 using a forloop
This problem can be approached from several different angles:
The first possibility is that we loop from 3 to 21 and add 3 to the loop counter each time we print
For LoopCounter = 3; LoopCounter <= 21; LoopCounter = LoopCounter + 3
Print LoopCounter
Next
OR we can loop from 1 to 21, and only print out the numbers that are evenly divisible by 3
For LoopCounter = 1 to 21
If (LoopCounter MOD 3) = 0 Then
Print LoopCounter
End If
Next LoopCounter
5) Using pseudocode declare a Real number named temperature
Final Answer:
Declare temperature as Real
or this could be:
Declare temperature as Float
it just depends on which way you learned in class. Real is pseudocode, Float is what most real programming languages use.
6) Using pseudocode declare a variable to store the Julian day (1366) named JDay.
Declare JDay as Integer
jeff and other Programming Specialists are ready to help you
Ask your own question now
Share this conversation
Related Programming Questions
Question
Date Submitted
I need the assistance of a SQL programmer that is extremely
10/21/2016
10/21/2016
Steve
Create an ER Crow's Foot data model for a real estate firm
10/20/2016
10/21/2016
LogicPro
I am trying to use robotic process automation and started
10/20/2016
10/20/2016
Russell H.
I have a list of customers in column a, in column is a job I
10/18/2016
10/19/2016
Pete
Here is a HW problem that should need to use R software to
10/18/2016
10/20/2016
George Sibiya
I have a program called winstart is it a necessary file or
10/17/2016
10/17/2016
Viet  Programmer
I want run this code on the server and I do not want the
10/15/2016
10/17/2016
George Sibiya
I was looking for the same type of template or excel
10/12/2016
10/13/2016
Pete
Please, I have a problem with adobe muse, I MAKE THE SITE
10/11/2016
10/11/2016
Pete
I need help with my hangman program in java. It is just a
10/10/2016
10/10/2016
LogicPro
X
Ask a Programmer
Get a Professional Answer. 100% Satisfaction Guaranteed.
33 Programmers are Online Now
Type Your Programming Question Here...
characters left: