Question

Fill in each column with the value of the vari- able after each line of code has run. If the vari- able has not been declaredneed explanation thx

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

Solution

Answer

let x: number = 15; let yż number: x = x + 8; let z: number = 9; y = x+z; 15 ? 15 * 23 * 23 23 32 ? ? ? 9

Explanation

let x: number = 15; 15 ? ?

in this statement x is declared and initialized to 15

so we write

x=15

but y and z not declared and initialized so we write "?"

---

15 ? ? let x: number = 15; let y: number, 15

in this statement we declare y but not initialized so we write "*

---

let x: number = 15; let y: number: x = x+8; 15 ? 15 * ? ? 23

in this statement now we are adding value 8 to the value of x

x=15+8

x=23

y already declared, z still not declared

---

let x: number = 15; let y: number; x = x+8; let z: number = 9; 15 ? 15 * 23 * 23 * ? ? ? 9

now z is declared and initialized

so write 9 in z

please note y still not initialized

---

15 ? * ? ? Tev y. number, 15 let x: number = 15; let y: number; x = x + 8; let z: number = 9; y = x+z; 23 * 23 * 23 32 ? 9 9

now we are adding value of x and z storing in y

so y=23+9

y=32

---

all the best

Add a comment
Know the answer?
Add Answer to:
need explanation thx Fill in each column with the value of the vari- able after each...
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
  • i need help writing this in C code Give a memory snapshot after each statement is...

    i need help writing this in C code Give a memory snapshot after each statement is executed, assuming that x is equal to 2 and that y is equal to 4 before the statement is executed. Also, assume that all the variables are integers. z = x++*y; x += y; z = ++x*y; y %= x;

  • 1. Please fill in the cells according to the given statements for each row. If the...

    1. Please fill in the cells according to the given statements for each row. If the statement runs correctly, it returns true or false, in this case please state the output in the fourth column. If the statement gives an error (i.e. compile or runtime error), please indicate that by typing the corresponding column (2nd or 3rd column). For each item, please write a one-sentence explanation. Note that each row will contain only one result. (15 points in total) }...

  • #7. TRUE/FALSE. Determine the truth value of each sentence  (no explanation required). ________(a)   k in Z  k2 + 9 = 0....

    #7. TRUE/FALSE. Determine the truth value of each sentence  (no explanation required). ________(a)   k in Z  k2 + 9 = 0. ________(b)  m, n in N,   5m 2n  is in N.    ________(c)   x in R, if |x − 2| < 3, then |x| < 5. #8. For each statement, (i) write the statement in logical form with appropriate variables and quantifiers, (ii) write the negation in logical form, and (iii) write the negation in a clearly worded unambiguous English sentence....

  • I need to run each questions also with the outputs print 1. 3.1 Write an if...

    I need to run each questions also with the outputs print 1. 3.1 Write an if statement that assigns 0 to x when y is equal to 20. If (y == 20) X=0; 2. 3.2 Write an if statement that multiplies payRate by 1.5 if hours is greater than 40. If (hours > 40) payRate - payRate * 1.5; 3. 3.12 Write nested if statements that perform the following test: If amounti is greater than 10 and amount 2 is...

  • Lab Objectives Be able to write methods Be able to call methods Be able to declare...

    Lab Objectives Be able to write methods Be able to call methods Be able to declare arrays Be able to fill an array using a loop Be able to access and process data in an array Introduction Methods are commonly used to break a problem down into small manageable pieces. A large task can be broken down into smaller tasks (methods) that contain the details of how to complete that small task. The larger problem is then solved by implementing...

  • Assembly language (MIPS) Let register $8 be x and register $9 be y. Write a program...

    Assembly language (MIPS) Let register $8 be x and register $9 be y. Write a program to evaluate: Z = 3x - 5y+5 Leave the result in register $10. Inspect the register after running the program to check that the program works. Run the program several times, initialize x and y to different values for each run.

  • math final 172 Problems 16-17 are worth 8 credits each 1 Let fx)9 and let ga)-1. Specity the domain of f(x)/slz). 2. Draw the graph of y 3cos 2x from z0to x-2 3. Draw the graph of y 4-+2. 4Write a...

    math final 172 Problems 16-17 are worth 8 credits each 1 Let fx)9 and let ga)-1. Specity the domain of f(x)/slz). 2. Draw the graph of y 3cos 2x from z0to x-2 3. Draw the graph of y 4-+2. 4Write an equation of the line perpendicular to the line y-2r-3 through (4,1) and sketch its graph. 5. Draw the graph of y- -2r-2 and label its maximum 6. Draw the graph of y-V-I 7. In triangle ABC, side a-8 in.,...

  • need help with a few excercises on general concepts using JAVA language. Try it: what is...

    need help with a few excercises on general concepts using JAVA language. Try it: what is the value of x after each operation? int x = 9; int y = 5; x = x/y; x += 6; x++; x--;I x %= 5; Try it: • What do these evaluate to? int x = 4; int y = ++X – 3 * 2; int z = x++ - 3 * 2; int w = x + 6/2; int t = x+...

  • Need help with these questions in C programming: 9. What is the output of the following...

    Need help with these questions in C programming: 9. What is the output of the following code? int X[10]={0}; int N=4; for(int k=0; k<N:k++) X[k] = k*2: printf("%d", X[N/2]; 10. Write a single statement to accomplish each of the following. Assume that each of these statements applies to the same program. a. Write a statement that opens file "oldmast.dat" for reading and assigns the returned file pointer to ofPtr. b. Write a statement that opens file "trans.dat" for writing and...

  • Question 1 When you declare a variable of type Single, it contains 0 by default. True...

    Question 1 When you declare a variable of type Single, it contains 0 by default. True False Question 2 The following line declares an array that can contain whole numbers, with 10 elements. Dim Variables(9) As Integer True False Question 3 Once a variable is declared we can not change the variable's data type. True False Question 4 If A is False and B is True, then A Or B is True because A is False. True False Question 5...

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