Java | JSP | JSF Answers

Questions: 4 418

Answers by our Experts: 3 943

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 & Filtering

In physics, an object that is in motion is said to have kinetic energy. The following formula can be used to determine a moving object’s kinetic energy:

K E = 1 2 m υ 2 


The variables in the formula are as follows: KE is the kinetic energy, m is the object’s mass in kilograms, and v is the object’s velocity in meters per second.

Create a Java program with a function that accepts an object’s mass (in kilograms) and velocity (in meters per second) as arguments. The function should return the amount of kinetic energy that the object has. Ask the user to enter values for mass and velocity, and then call the function you created to get the object’s kinetic energy. 


sample output:

Enter mass in kilograms: 71

Enter velocity in meters per second:  5.5

The object's kinetic energy is: 1073.88 J.



Write a program to create two SDAs in order to store 5 numbers and 6 numbers respectively, then merge the values of both the arrays into third array so that the values of first array will be kept first from left to right followed by the values of second array, again from left to right, then display values of the merged array.

What's in There?

by CodeChum Admin

Let's try defining the size of the list and create the contents of it on our own! And then, to give off a sense of excitement, let's try accessing the value of a list element in a random index position!


Let's do this fast!


Instructions:

  1. Create a variable that accepts a positive integer.
  2. Create an empty list. Then, using loops, add string values to your list using the input() function. The number of string values to be added are dependent on the inputted value on the first inputted integer.
  3. Create another variable that accepts a non-negative integer. The number must only range from 0 until the value of the first inputted integer.
  4. Using your understanding on accessing list elements, access and print out the list element having the index position of the second inputted integer.

 Search and Rescue

by CodeChum Admin

Make a program that will accept an integer and loop for the same number of times as that of the inputted integer and input random integers and add it to the array/list one by one, per line. Afterwards, make your program accept another random integer.

Using that final integer, compare from your array/list if the final integer's value is also present in your current array/list. If so, print "Present"; otherwise, print "None".


Start coding now!


The Big One

by CodeChum Admin


Remember that time when we've tried identifying the largest digit among the given integer? Well, let's take it to the next level, and figure out the same thing on arrays/lists!




Let's do this one more time!




Instructions:


Create a variable that accepts a positive integer.

Create an empty list. Then, using loops, add random integer values into the list one by one. The number of values to be stored is dependent on the inputted positive integer given in the first instruction.

Print out the largest integer among all the elements on the list, by any means necessary.


Create a class called Programmer that includes three pieces of information as instance variables – full name (type String), salary (type double) and age (type int). Your class should have a constructor that initializes the three instance variables. Provide a method named printProgrammerDetails that displays programmer's full name, salary and age. Write a test application named ProgrammerTest that demonstrates class Programmers’s capabilities

Challenging Numerical Triangles

by CodeChum Admin

You probably have encountered Triangle pattern problems before when you started learning programming. Let’s see how well you do with numbers this time. Try to look at the examples closely and think of an algorithm that replicates the outputs. Go for it!


The Perfectionist's Problem

by CodeChum Admin

I am what you call a perfectionist. I always strive for perfection, and I appreciate everyone and everything that is perfect. That is why I have recently acquired an appreciation for perfect numbers! I absolutely need to know which numbers from 1 to 1000 are considered perfect. From what I recall, a perfect number is a positive integer that is equal to the sum of all its divisors other than itself.


Example:

6 is a perfect number because 6 = 1 + 2 + 3 


Challenging Numerical Triangles


by CodeChum Admin



You probably have encountered Triangle pattern problems before when you started learning programming. Let’s see how well you do with numbers this time. Try to look at the examples closely and think of an algorithm that replicates the outputs. Go for it!



Input



A single line containing an integer n.



9


Output



The output generated based on the inputted integer n.



1


23


456


789

What is the variable x after the statement “f 2 + 3 = 6 if and only if 3 + 2 = 5,x =



x+1”, if x = 2?