*Given answer choices A-E, what is the code's output?
1. Given the following code, the output is __.
String str1 = new String("Apple");
String str2 = "Apple";
System.out.print(str1 == str2);
Answer Choices:
A. 0
B. 1
C. false
D. true
E. str1 == str2
Write a Java code that uses an input dialog box to ask the user to enter a sentence that may or may not contain a substring, “Ruby”.
Use the an appropriate Java method (e.g. “contains()”) to check if the given string contains the word “Ruby”. If not, display “The substring 'Ruby' is not found.” in a message box. If found, replace every occurrence of the work “Ruby” with “Java”, and then display the revised sentence in a message box.
Test the program three times. First, test the program without the “Ruby” substring. Second, test the program with one occurrence of the “Ruby” substring. Third, test the program with two or more occurrences of the “Ruby” substring.
Create a program that uses a dialog box to ask “Enter a sentence.”, take the user input, and then store the user input in a string variable.
Use the “split()” method to break the address into an array of String type. Then, use a “for..in” (also known as “for..each”)loop to display every word in a one-word-per-line manner in one dialog box.
Then, use: (1) the “toUpperCase()” method to convert every character to uppercase, (2) the toCharArray() method to break the same string literal to an array of char type, and (3) a “for” loop to display every element of the char array in a one-character-per-line manner in another dialog box.
Write a program that ask user to enter type. Print "Credit Card" if the type is CC, and if the type is CS print "Cash". Otherwise, print "Invalid Payment".
Create a program that accept the cost of postage on a letter and compute the tax according to the following scale: 50 pesos below a 5% tax added to the cost of the mail, 51 pesos above a 7% is added to the cost of the mail and plus 10 pesos service charge if the customer desires special delivery
Write a function named "g_c_d" that takes two positive integer arguments and returns as its value the greatest common divisor of those two integers. If the function passed an argument that is not positive (i.e., less than zero), then the function should return the value 0 as a sentinel value to indicate that an error occurred. Thus, for example:
cout << g_c_d(40,50) << endl; // will print 10
cout << g_c_d(256,625) << endl; // will print 1
cout << g_c_d(42,6) << endl; // will print 6
cout << g_c_d(0,32) << endl; // will print 0
cout << g_c_d(10,-6) << endl; // will print 0
A positive integer n is said to be prime (or, "a prime") if and only if n is greater than 1 and is divisible only by 1 and n. For example, the integers 17 and 29 are prime, but 1 and 38 are not prime. Write a function named "is_prime" that takes a positive integer argument and returns as its value the integer 1 if the argument is prime and returns the integer 0 otherwise. Thus, for example:
cout << is_prime(19) << endl; // will print 1
cout << is_prime(1) << endl; // will print 0
cout << is_prime(51) << endl; // will print 0
cout << is_prime(-13) << endl; // will print 0
Write a function named "sum_from_to" that takes two integer arguments, call them "first" and "last", and returns as its value the sum of all the integers between first and last inclusive. Thus, for example:
cout << sum_from_to(4,7) << endl; //will print 22 because 4+5+6+7 = 22
cout << sum_from_to(-3,1) << endl; //will print -5 'cause (-3)+(-2)+(-1)+0 +1 = -5
cout << sum_from_to(7,9) << endl; //will print 22 because 7+8+9 = 2
cout << sum_from_to(9,9) << endl; //will print 9
Write separate queries using a join, a subquery, a CTE, and then an EXISTS to list all AdventureWorks customers who have not placed an order.
Unite Family inputs from keyboard only.which means user decide the inputs
Given three objects
SampleInput 1(from user side from keyboard)
{'surname' : 'Williams', 'city': 'Columbia'}
{'dish': 'cakes'}
{'pet': 'Rocky'}
Sample Output 1(inputs from user)
Mr and Mrs Williams went to a picnic in Columbia with a boy and a pet Rocky. Mrs Williams made a special dish "cakes"