Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

*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


father, mother, and child, write a JS program to concatenate all the objects into the family object using the spread operator.Input

  • The first line of input contains an object father
  • The second line of input contains an object mother
  • The third line of input contains an object child

Output

  • The output should be a single line string with the appropriate statement as shown in sample outputs

Constraints

  • Keys of the objects should be given in quotes


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"




LATEST TUTORIALS
APPROVED BY CLIENTS