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

Write a method called sumFirstAndLastDigist() with one parameter of type int called number.

The methods needs to find the first and Last digist of the parameter number passed to the method, using a loop and return the sum of the first and Last digist


display prime numbers from 5 to 5000 using the while loop, for loop and do while loop


Display even numbers from 5 to 5000 using the while loop ,for loop and do while loop


display multiples of 5 to 5000 using the while loop,for loop and do while loop


Write a program to take a String as input then display the first and last letter of each word with a condition that if it is having one character then it will remain as it is using only indexOf() function.

For example:

Enter a String

ASia is A conTinEnT

Modified: Aa is A cT


Write a program to take a String as input then display the position of a particular character given as input using indexOf() function of String class. Don't use charAt() function.

Enter a String

JapanIsSupremE

Enter character to find: e

Index Position: 11


Write a program to take a String as input then display the palindrome word in one column and its position in another column.

Example:

Enter a String

My Mom brought a racecar

Mom \t 2

racecar \t 5


for(i=0;i<l;i++) {

c = s.charAt(i);

if(c != ' ') {

w=w+c;

r=r+c;

} else {

if(w.compareToIgnoreCase(r)==0)

w=""; r=""; //Use this code to search palindrome words


Create a console calculator application that:

-Takes one command-line argument; your name and surname. When the program starts, display the date with a welcome message for the user

-Your calculator must include the arithmetic operations, as well as at least 5 scientific operations of the Math class. It's must also have the ability to round a number and truncate it. When you multiply by 2, Don't use the * operator to perform the operation (use shift operators). It must also be able to reverse the sign of a number.

-Includes sufficient error checking to ensure that the user only enters valid input. Make use of the String, Character and other wrapper classes

-Is able to do conversions between decimal, octal and hexadecimal numbers.

-Makes use of a menu. You should give the user the option to end the program when enters a certain option.

-Displays a message for the user, stating the current time, calculates and displays how long the user used your program, when the program exits.


Write a program to implement the following: create a class representing a

company where a company has a minimum and maximum limit of the

quantity of products. Allow the user to order from the company product

list (create a list of any ten products). Apply proper constraint if user

order more than the quantity available with the company. Based on the

quantity generate the customer bill.


Leftovers

by CodeChum Admin

We Filipinos are quite known for the habit of leaving at least one of the many pieces of food on the plate as it can't be equally divided among all at most times. Just like when 3 people decide to eat a pizza of 10 slices, there will often be at least one slice left on the box. To accurately show just how many pieces of things are left when divided by a certain number, we code it using modulo.

Care to do it for me?


Input

A line containing two integers separated by a space.

10·3

Output

A single line containing an integer.

1




LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS