Questions: 856

Answers by our Experts: 763

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

State whether each of the following is true or false. If false, explain why.

a. An algorithm is a procedure for solving a problem in terms of the actions to execute and the order in which these actions execute.

b. A set of statements contained within a pair of parentheses is called a block.

c. A selection statement specifies that an action is to be repeated while some condition remains true.

d. A nested control statement appears in the body of another control statement.

e. Java provides the arithmetic compound assignment operators +=, -=, *=, /= and %= for abbreviating assignment expressions.

f. The primitive types (boolean, char, byte, short, int, long, float and double) are portable across only Windows platforms.

g. Specifying the order in which statements (actions) execute in a program is called program control.

h. The unary cast operator (double) creates a temporary integer copy of its operand.

i. Instance variables of type boolean are given the value TRue by default.

j. Pseudocode helps a programmer think out a program before attempting to write it in a programming language.

 

Write four different Java statements that each add 1 to integer variable x.


State whether each of the following is true or false. Explain why.

  1. The default case is required in the switch selection statement.
  2. The break statement is required in the last case of a switch selection statement.
  3. The expression ( (x > y) && (a < b ) ) is true if either x > y is true or a < b is true.
  4. An expression containing the || operator is true if either or both of its operands are true.
  5. The comma (,) formatting flag in a format specifier (e.g., %,20.2f) indicates that a value should be output with a thousands separator.
  6. To test for a range of values in a switch statement, use a hyphen () between the start and end values of the range in a case label.
  7. Listing cases consecutively with no statements between them enables the cases to perform the same set of statements.

It is late at night, and you decide to get a glass of milk before bed. Try to write

pseudocode describing the process of going to the kitchen and getting the milk. Be

very specific and make sure you have all actions in the correct sequence. For example,

remember you must open the refrigerator door before you reach in to retrieve the milk

container. What if there is no glass in the cupboard? Did you check whether the glass

was right side up before you started pouring? Now consider how many small

decisions you make every day, and consider how involved it would be to write a

program to instruct a robot to do the things you do in a day!


State whether each of the following is true or false. If false, explain why.

  1. An algorithm is a procedure for solving a problem in terms of the actions to execute and the order in which these actions execute.
  2. A set of statements contained within a pair of parentheses is called a block.
  3. A selection statement specifies that an action is to be repeated while some condition remains true.
  4. A nested control statement appears in the body of another control statement.
  5. Java provides the arithmetic compound assignment operators +=, -=, *=, /= and %= for abbreviating assignment expressions.
  6. The primitive types (boolean, char, byte, short, int, long, float and double) are portable across only Windows platforms.
  7. Specifying the order in which statements (actions) execute in a program is called program control.
  8. The unary cast operator (double) creates a temporary integer copy of its operand.
  9. Instance variables of type boolean are given the value TRue by default.
  10. Pseudocode helps a programmer think out a program before attempting to write it in a programming language.

 

Write four different Java statements that each add 1 to integer variable x.


Explain four (4) reasons why its necessary to use methods in your Java programs.


Assignment 1


Write a program in Java that returns the maximum for three numbers


Assignment 2

Based on Assignment 1, write an algorithm for your implementation



It is late at night, and you decide to get a glass of milk before bed. Try to write

pseudocode describing the process of going to the kitchen and getting the milk. Be

very specific and make sure you have all actions in the correct sequence. For example,

remember you must open the refrigerator door before you reach in to retrieve the milk

container. What if there is no glass in the cupboard? Did you check whether the glass

was right side up before you started pouring? Now consider how many small

decisions you make every day, and consider how involved it would be to write a

program to instruct a robot to do the things you do in a day!


Draw a flow chart to compute the sum of the series: 

𝑓(𝑥) = 1 + 𝑥 + 𝑥

2 + 𝑥

3 + … + 𝑥

𝑛


Provide a Pseudocode to illustrate the assignment of 10 to X if X < Y otherwise 

5 is assigned to X.


Flow chart for the sum of the series f(x)=1+x +x^2+x^3+...+x^n


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS