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 2 other Programming Specialists are ready to help you
Ask your own question now
Share this conversation
Related Programming Questions
Question
Date Submitted
What is the formula to take 5% of a number over a certain
1/23/2017
1/23/2017
Richard
I have an Excel pivot question, Mac 2011, I have a
1/22/2017
1/22/2017
ThePCGuy
New to object oriented programming and I need to come up
1/17/2017
1/18/2017
LogicPro
I need to run an excel macro that needs to do the following:
1/16/2017
1/16/2017
Richard
I need to know how to organize data from a list on a
1/15/2017
1/15/2017
Michael Hannigan
How am I able to write in excel to add up total runtime
1/15/2017
1/15/2017
Michael Hannigan
OKPR113211 What would the best language to develop and
1/14/2017
1/17/2017
ehabtutor
Adding To and Removing From an Integer List File
1/10/2017
1/10/2017
LogicPro
Interest = "Balance * InterestRate" / 12 Balance = Balance +
1/10/2017
1/11/2017
LogicPro
I need to add a function in my existing application that
1/9/2017
1/9/2017
LogicPro
X
Ask a Programmer
Get a Professional Answer. 100% Satisfaction Guaranteed.
42 Programmers are Online Now
Type Your Programming Question Here...
characters left: