Question

for java

12) Suppose you have defined variables int x 42 String y =lunchtime a) Evaluate each expression below y.equals (breakfast

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

Solution

12)

a)

false
true
false

Explanation

lI Result Execute Share Source File STDIN public class problema { public static void main(String [Jargs) { int x - 42; String

b)

x is at least 25 True

x is between 25 and 50, inclusive (i.e., including the endpoints of the interval) True

y is either 10 or 12 characters long False

x is equal to the three times the length of y False

the length of y is not divisible by 3 False

x is negative or else x is even and divisible by 3 True

y is not equal to the string “dinner” True

--

all the best

Add a comment
Know the answer?
Add Answer to:
for java 12) Suppose you have defined variables int x 42 String y ="lunchtime" a) Evaluate...
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
  • Suppose you have two variables x and y defined. Write a stub if statement to evaluate...

    Suppose you have two variables x and y defined. Write a stub if statement to evaluate whether x is less than y. The statement should not do anything, even if the condition is true.

  • 1. Suppose you have two random variables, X and Y with joint distribution given by the...

    1. Suppose you have two random variables, X and Y with joint distribution given by the following tables So, for example, the probability that Y o,x - 0 is 4, and the probability that Y (a) Find the marginal distributions (pmfs) of X and Y, denoted f(x),J(Y). (b) Find the conditional distribution (pmf) of Y give X, denoted f(YX). (c) Find the expected values of X and Y, EX), E(Y). (d) Find the variances of X and Y, Var(X),Var(Y). (e)...

  • QUESTION 1 In Java, all variables declared using a class are ____. a. reference variables b....

    QUESTION 1 In Java, all variables declared using a class are ____. a. reference variables b. constants c. primitive variables d. operators 1 points    QUESTION 2 An expression such as str.length(); is an example of a(n) ____. a. system call b. method call c. object call d. class 1 points    QUESTION 3 Consider the following statements. double x; String y; y = String.format( "%.2f", x); If x = 285.679, what is the value of y? a. "285.00" b....

  • Must be in Java. Show proper reasoning with step by step process. Comment on the code...

    Must be in Java. Show proper reasoning with step by step process. Comment on the code please and show proper indentation. Use simplicity. Must match the exact Output. CODE GIVEN: LineSegment.java LineSegmentTest.java Point.java public class Point { private double x, y; // x and y coordinates of point /** * Creates an instance of Point with the provided coordinates * @param inX the x coordinate * @param inY the y coordinate */ public Point (double inX, double inY) { this.x...

  • Some java questions: 18. Consider the following class definitions public class TestAB public static void main (String a...

    Some java questions: 18. Consider the following class definitions public class TestAB public static void main (String args) A bl new B() в ь2 -new B() ; b1.х, А.у, Ь2.х, в.у); System.out.printf ("%d, Sd, %d, d\n", class A public int x = 2; public static int y = 4; public A () ( X=y- class Bextends A public int x = 32; public static int y = 45; public B ( x ++y What is the result of attempting to...

  • 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...

  • QUESTION 1 Given two double variables named x and y, which of the following statements could...

    QUESTION 1 Given two double variables named x and y, which of the following statements could you use to initialize both variables to a value of 0.0? a. x | y = 0.0; b. x = y = 0.0; c. x, y = 0.0; d. none of the above 1 points    QUESTION 2 When you use a range-based for loop with a vector, you a. can avoid out of bounds access b. must still use a counter variable c....

  • Question 7 3 pts Suppose that you have 50 observations on the variables Y and X....

    Question 7 3 pts Suppose that you have 50 observations on the variables Y and X. If the sample correlation coefficient is 0.5 (r=0.5), and you want to test the null hypothesis that the true population correlation coefficient (rho) is equal to zero, then the test statistic associated with this null hypothesis is: o 5 04 O2 O 3 Question 8 3 pts Suppose you estimate a multiple regression model using OLS and the coefficient of determination is very high...

  • This is for a java program public class Calculation {    public static void main(String[] args)...

    This is for a java program public class Calculation {    public static void main(String[] args) { int num; // the number to calculate the sum of squares double x; // the variable of height double v; // the variable of velocity double t; // the variable of time System.out.println("**************************"); System.out.println(" Task 1: Sum of Squares"); System.out.println("**************************"); //Step 1: Create a Scanner object    //Task 1. Write your code here //Print the prompt and ask the user to enter an...

  • QUESTION 1 What will be displayed as a result of executing the following code? int   x...

    QUESTION 1 What will be displayed as a result of executing the following code? int   x = 5, y = 20; x += 32; y /= 4; cout <<"x = " << x <<"y = " << y; A. x = 32, y = 4 B. x = 9, y = 52 C. x = 37, y = 5 D. x = 160, y = 80 8 points    QUESTION 2 What will be the displayed when the following code...

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