What will be the output of this ternary operation? int x = 10, y = 5;String message = x > y ? “panther” : “dolphin”);System.out.println(message);
Blog
Rewrite this if-else statement using a ternary operator (one…
Rewrite this if-else statement using a ternary operator (one line of code only): if (price> 30) { discount = 0.3; } else { discount = 0.1; }
Find the error in the following code and discuss how to fix…
Find the error in the following code and discuss how to fix it. public class Test{public static void main(String[] args){ double x = 6.50; //we created a double variable int y; /*In the next line, we convert the double value to an integer value */ y = (double) x; } }
Explain the difference between primitive data types and refe…
Explain the difference between primitive data types and reference data types in Java
What is the difference between if-else and switch statements…
What is the difference between if-else and switch statements?
What will be the expected output after the following stateme…
What will be the expected output after the following statements are executed? char custType = ‘b’; switch (custType) { case ‘A’: System.out.println(“The customer type is A”); break; case ‘B’: case ‘b’: System.out.println(“The customer type is B”); case ‘C’: System.out.println(“The customer type is C”); default: System.out.println(“The customer type is D”); }
Write the expected output for the following code. String m…
Write the expected output for the following code. String msg = “I am enjoying this class.”; String msg1 = msg.toUpperCase(); String msg2 = msg.toLowerCase(); char ltr = msg.charAt(6); int strSize = msg.length(); System.out.println(msg); System.out.println(msg1); System.out.println(msg2); System.out.println(“Character at index 6 = ” + ltr); System.out.println(“msg has ” + strSize + “characters.”);
The Joiner 4GM book discusses a situation involving an auto…
The Joiner 4GM book discusses a situation involving an auto manufacturer and its two suppliers of transmissions. The transmissions from both suppliers consistently met specifications with no defectives. Nevertheless, the transmissions from Supplier A experienced more customer complaints and warranty service work, while the transmissions made by Supplier B performed well and rarely experienced warranty service work. Briefly explain the reason for the difference. Why did the transmissions from Supplier A and Supplier B perform differently even though they all met specifications?
Which of the major perspectives for defining quality is illu…
Which of the major perspectives for defining quality is illustrated by this McDonald’s ad? Explain using at least several sentences.
Direct and personal marketing efforts will continue to grow…
Direct and personal marketing efforts will continue to grow to meet the needs of consumers who no longer have the time to spend shopping and making purchase decisions. Which tool helps marketers meet this demand of consumers?