Java

posted by .

1 public class testOperators
2 {
3 public static void main(String[] args)
4 {
5 int x;
6 int y = 12
7 double z = 13.0;
8 x = 14
9 System.out.println(“x + y + z = “ + (x + y +z));
10 x += y;
11 y--;
12 z++;
13 z *= x;
14 System.out.println(“x + y + z = “ + (x + y + z));
15 }
16 }

Trace:
Line # X Y Z Output
5 ?
6 12
7 13.0
8 14
9 x + y + z = 39.0
10 26
11 11
12 14.0
13 364

  • Java -

    Are these the answers or the quetions?

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Computer Science (Basics)

    public class Circumference { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub ; final double PI = 3.14159; int radius = 10; double area = PI * radius *radius; double circum = 2 * PI * …
  2. Java

    I need help putting the following trace into pseudocode 1 public class testOperators 2 { 3 public static void main(String[] args) 4 { 5 int x; 6 int y = 12 7 double z = 13.0; 8 x = 14 9 System.out.println(“x + y + z = “ + (x + …
  3. Computer Science

    //program that puts two lists in order in one single list with all the numbers in order import java.util.Scanner; public class listOrder { public static void main (String [] args){ int [] list1; int [] list2; int [] list3; int temp; …
  4. Computers

    //program that puts two lists in order in one single list with all the numbers in order import java.util.Scanner; public class listOrder { public static void main (String [] args){ int [] list1; int [] list2; int [] list3; int temp; …
  5. Computer Sciene-java

    Write a loop that will continuously prompt the user for integers to sum, -1 to exit. Sum these values and display the sum to the console. Here is what I have so far, but I feel like I am missing something: public class Sum1 { public …
  6. Computer Science

    I posted this question before. The assignment was: write a Java method if the first parameter is less than the second parameter add the two and print the result ten times. How do I write the result 10 times as a loop?
  7. Computer Science

    How would I put this into one program? These are the directions: Write a method that takes two parameters. If the first parameter is equal to second parameter. Multiply both and print result. If the first parameter is less than the
  8. Computer Programming

    I already posted this question but I gave it a try I'm not sure if I'm on the right track: Make a util class with three methods. First method's name is add, that returns the result by adding two numbers. Second method's name is multiply, …
  9. Computer Science

    public class PrimeNumbers { public static void main(String[] args) { int x = 100; for(int i=2; i <= x; i++) { if(i%2==0) System.out.println("notprime"); System.out.println(i) ; if(i%1==1) System.out.println("prime"); } }
  10. Java programming

    Hi, I'm trying to figure out how to implement toString() methods into the JavaTest and H2ClassB classes so that the output would be 4 3 7 5 99 3: import java.util.ArrayList; public class JavaTest { ArrayList <JavaTest> list = …

More Similar Questions