Question

Problems 9-35 odd numbers only(9,11,13,15 …35)

k newNum numi (int) (4.6/2)1 . Do a walk-through to find the value assigned to e. Assume that all variables are properly declared. a -31 es (a%b) * 6; e-(a b+ d)/ 4 10. Which of the following variable declarations are correct? Ifa variable declaration is not correct, give the reasoníy) and provide the correct variable declaration. n = 12; char letter int one = 5, two; //Line 3 double x, Y zi //tine 1 //tine 2 //Line 4 Which of the following are valid Java assignment statements? Assume that i, x, and percent are double variables. b, x+2=x; 6, percent-10 . Write Java statements that accomplish the following. a. Declare int variables x and y b. Initialize an int variable x to 10 and a char variable ch to B c. Update the value of an int variable x by adding 5 to it. . Declare and initialize a double variable payRate to 12.50 Copy the value of an int variable firstNum into an int variable tempNum. Swap the contents of the int variables x and y. (Declare additional variables, if necessary.) s Suppose x and y are double variables. Output the contents of x , y, and the expression x + 12/y 18 Declare a char variable grade and set the value of grade to A I Declare int variables to store four integers the value of a double variable z to the nearest integer into Copy an int variable x. Write each of the following as a Java expression. 32 times a plus b The characier that represents 8

0 0
Add a comment Improve this question Transcribed image text
Answer #1

As per Chegg guidelines an expert is not allowed to answer more than 4 questions if there are more than 2 questions. If an expert breaks the rules the account will be revoked. As i should not violate the guidelines I answer first 4 questions.


9. 7
11. a , c
13.
a) 32 * a + b;
b) char c = '8';
c) String name = "Julie Nelson";
d) (b * b - (4 * a * c)) / 2 * a
e) (a + b) / (c * (e * f) - (g * h))
f) (-b + ( b * b - (4 * a * c))) / 2 *a
15. x = 20 y = 15 z = 6 w = 11.5 t = 4.5
17.
a) x = 2, y = 5, z 6
b) x + y = 7
c) Sum of 2 and 6 is 8
d) z / x = 3
e) 2 times 2 = 4

**Comment for any further queries.

Add a comment
Know the answer?
Add Answer to:
Problems 9-35 odd numbers only(9,11,13,15 …35) k newNum numi (int) (4.6/2)1 . Do a walk-through to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Homework Part 1 Write a C program that declares and initializes a double, an int, and a char. You...

    Homework Part 1 Write a C program that declares and initializes a double, an int, and a char. You can initialize the variables to any legal value of your choosing. Next, declare and initialize a pointer variable to each of the variables Using printf), output the following: The address of each of the first three variables. Use the "Ox%x" format specifier to print the addresses in hexadecimal notation The value of each variable. They should equal the value you gave...

  • #include <stdio.h> int main(int argc, char *argv[]) {      char a, *pc, c[9];      int i, *pk, k[9];      a='...

    #include <stdio.h> int main(int argc, char *argv[]) {      char a, *pc, c[9];      int i, *pk, k[9];      a='z';      pc=&(c[8]);      pk=&(k[0]);      for (i=0; i<9; i++)     {           *pc=a-(char)i;           pc--;           *pk=(int)a-i;           pk++;           }                     return 0; }//end of main Answer the below questions with the above code Write out the memory map for the above C code in the following table. For array variables, list the address range for the entire array. Assume the memory address starts from 100, that is, the address for a...

  • 4. Write an if/else statement in ternary format that compares the value of two int variables, firstNum and secondNum, and sets the value of an int variable minValue appropriately as follows: minValue...

    4. Write an if/else statement in ternary format that compares the value of two int variables, firstNum and secondNum, and sets the value of an int variable minValue appropriately as follows: minValue should be the minimum of firstNum and secondNum. 5. Assume that Person is a predefined class and that the declaration Person[] people; has already been performed. Then the instruction People = new Person [200]; Reserves memory space for(Circle the answer):      Option 1: a single Person object      Option 2:...

  • 4. Write an if/else statement in ternary format that compares the value of two int variables,...

    4. Write an if/else statement in ternary format that compares the value of two int variables, firstNum and secondNum, and sets the value of an int variable minValue appropriately as follows: minValue should be the minimum of firstNum and secondNum. 5. Assume that Person is a predefined class and that the declaration Person[] people; has already been performed. Then the instruction People = new Person [200]; Reserves memory space for(Circle the answer):      Option 1: a single Person object     ...

  • C language not C++ 1. Write the statements to do the following: (2 pts) a. Define...

    C language not C++ 1. Write the statements to do the following: (2 pts) a. Define a struct with member variables width, height, topleft x, topleft y all floats). Use a tag to call it Rectangle. b. Declare a variable struct type Rectangle 2. Consider the following variables: struct int x; float y; char zi var1; union nt x; float y; char[20] z;) var2 f float and int are stored using 4 bytes each, what is the size (in bytes)...

  • 1). The result of Java expression 5*7>3*(5+2) && 3*5-4<6 is ____ a. 35>35&&9<6 b. true &&...

    1). The result of Java expression 5*7>3*(5+2) && 3*5-4<6 is ____ a. 35>35&&9<6 b. true && false c. false d. False (2). You save text files containing Java language source code using the file extension___ a. .java b. .class c. .txt d. .src    (3). Which of the following is not a primitive data type in the Java programming language? a. boolean b. byte c. int d. Point (4). Given the Java statement int[][] vari = new int[5][7]; the value...

  • 1. Write a C++ statement that uses the manipulator setfill to output a line containing 35...

    1. Write a C++ statement that uses the manipulator setfill to output a line containing 35 stars, as in the following line: *********************************** 2. Suppose that x and y are int variables, z is a double variable, and ch is a char variable. Supposed the input statement is: cin >>x >>y >>ch >>z; What values, if any are stored in x, y, z, and ch if the input is: 35 62.78 86 32A 92.6 12 .45A 32 3. Supposed x...

  • Name: True/False & Multiple Choice (2 points each) (True / False ) 2 A char literal...

    Name: True/False & Multiple Choice (2 points each) (True / False ) 2 A char literal '2', a string literal "2", and the numeric literal 2 are identical and stored the same way though they are different types. 3 Since comments do not affect the program execution, you don't need to have it at all. 4. After the following statements are executed, the value of the variable rem is 3. 1. A preprocessor directive line starts with a pound sign...

  • I had a few questions in Computer Science (Java). I got these questions wrong and I...

    I had a few questions in Computer Science (Java). I got these questions wrong and I would like the CORRECT answer and an EXPLANATION PLEASE. Please use the correct number when giving the answer such as 1a:. 1b: etc 1. For Each of the following Bits of code enter the final value of the variable names ans. a. int x = 23; int y = 7; Int ans = x % y; My answer 1.61 (Wrong It was 2) b....

  • Consider the following program: # include <iostream> using namesapce std; void Func(int a, int bl double...

    Consider the following program: # include <iostream> using namesapce std; void Func(int a, int bl double number-25.0: int main) f int x-18, y-20; cout<c"Before: x- kex<" and y-eyecendl; Fundxy 1// end of main void Funcfint a, int b) int sum a+b; a-200; b-300; numberanumber+1.0 Which of the statements below are correct? (Select only the correct answers. There may be more than one) D A The statement double number-25.0; declares a global variable number B. The variables x and y are...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT