Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Define these terms as they relate to Java Programming: a. Syntax b. Variable c. CPU d. Case sensitive 2. Write assignment statements to perform

1. Define these terms as they relate to Java Programming: a. Syntax b. Variable c. CPU d. Case sensitive 2. Write assignment statements to perform the following calculations. Assume all variables are declared as doubles. a. Add 4 to jam and store the result in f b. Multiply mommy by 2 and store the result in jonny c. Divide f by 4.3 and store the result in f d. Subtract m from f and store the result in j 3. Modify the following code snippet to print out a blank line between each line of output not necessarily each line of Java code. System.out.println(Hello dear Java student); System.out.print(I hope you get this right); System.out.println(This is tricky); System.out.println(The end); 4. What does the following line of code do? final double e = 2.17; 5. Evaluate these expressions according to Java rules for arithmetic operator precedence and write the answer. Note all of these values are WHOLE NUMBERS. To receive partial credit, show your intermediate steps in determining an answer. a. 7 + 3 * 4 b. 3 + 11 % 3 2 c. (4 + 3) / 2 2 d. 7 2 * 4 + 1 6. What does this code snippet produce as output? int speed = 30; int time = 40; int distance = speed * time; System.out.println(The distance is + distance); 7. Each different type of CPU has its own: A) Syntax B) Firmware C) Machine language D) Software 8. A computer program is: A) A set of instructions that enable the computer to solve a problem or perform a task B) Main memory C) Pseudocode D) A flow chart 9. Key words are: A) The data names in your program B) Words that have a special meaning in the programming language C) Symbols or words that perform operations on one or more operands D) Words or names defined by the programmer 10. Because Java byte code is the same on all computers, compiled Java programs: A) Must be re-compiled for each different machine it is run on B) Cannot run on Linux systems C) Are non-existent D) Are highly portable 11. When the + operator is used with strings, it is known as the: A) Assignment operator B) String concatenation operator C) Addition operator D) Combined assignment operator 12. Write a program to calculate the average of three test scores. Prompt the user for the three test scores. Each test score will be a whole number. The average should be calculated so that the average is displayed with a fractional part. My sample output is as follows: --------------------Configuration: -------------------- Enter first test score: 93 Enter second test score: 87 Enter third test score: 86 The average is: 88.66666666666667

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions