Java | JSP | JSF Answers

Questions: 3 611

Answers by our Experts: 3 611

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

class that stores a temperature in a temperature member variable and has the appropriate constructor, setter and getter functions. In addition to these, the class should have the following member functions:

• isEthylFreezing. This function should return the bool value true if the temperature stored in the temperature field is at or below the freezing point of ethyl alcohol. Otherwise, the function should return false.

• isEthylBoiling. This function should return the bool value true if the temperature stored in the temperature field is at or above the boiling point of ethyl alcohol. Otherwise, the function should return false. •



Write a program to calculate the property tax. property tax is calculated on 85% of the assessed value of the property. For example, if the assessed value is 500 000, the property tax is 425 000. Assume that the property tax rate is R1,25 for each R100 of the assessed value. Your program should prompt the user to enter the assessed value of the property. Store the output in a file in the following sample format:


Assessed Value: R 500 000.00

Taxable Amount: R 425 000.00

The tax rate for each R100.00 is R 1.25

Property Tax: R 5 312.50


Write a program that does the following:


a. Prompts the user to input five decimal numbers.

b. Prints the five decimal numbers.

c. Converts each decimal number to the nearest integer.

d. Adds the five integers.

e. Print the sum and the average of the five integers


Jaya Jusco (JJ) Sdn Bhd needs you to develop an application to calculate their customer JJ point’s reward. Define a class named Customer with the following variables declarations:


String CustName;

String CustAddress;

int pointRewards;

 

a)  Provide a default constructor and another constructor with three parameters. The constructor with parameters will assign the three values (String CustomerName, String CustomerAddress, int point). Define a public instance method named calculatePoint()to calculate the customer rewards if the point is greater than 300 points. The formula indicates that if the point is greater than 300 points, the system will add up extra 50 points.


b)Define another class named Testing to test the Customer class. Use the Scanner method to get the CustomerName, CustomerAddress and point values from the user. Declare class and create object Customer. Call the calculatePoint( ) method to display the current customer points reward.



  • ou must create a class named Bus.
  • You should also create a main class named Main.
  • In the Bus class, there should be member variables named:

   -length, capacity, speed (must be an integer)

   -fuel_capacity, fuel_burn_rate (must be a double) 

   -name, color (must be a string)

 

  • Create a constructor in the Bus class containing the parameters:

   -name

   -length

   -capacity

   -color

   -speed

   -fuel_capacity

   -fuel_burn_rate


The program shall:

• generate a random number from 1 to 50 for a player to guess;

• display a message that indicates whether the player's guess is correct, too low, or too high; • prompt the user to keep on guessing until the correct value is entered

4. Create a try-catch structure that will handle two (2) exceptions. These are when the user inputs the following:

• a number that is out of range (1 - 50) a letter or any non-numeric character

5. Prompt the user so that he can guess again if an exception is thrown.

6. Display the number of total guesses.

Note: An invalid input (when an exception is thrown) is not considered a valid guess or attempt. 

Sample Output:

Guess a number from 1 to 50!

30

Too high. Try Again.

10

Too high. Try again

qwerty

Invalid input.

Guess a number from 1 to 50!

51

Out of range.

Guess a number from 1 to 50!

1

Too low. Try Again.


Negative Allergy (JAVA)

by CodeChum Admin

Whole numbers are great, but I think we should also pay attention to decimal numbers, too.


So, how about we make a program that involves a lot of decimals?


Instructions:

  1. Continuously ask for floating point values (decimal numbers) using the do…while() loop, sum them all up, and store the total into one variable.
  2. The loop shall only terminate for the following reasons:
  3. A negative decimal number is inputted (but still included in the total sum)
  4. The total sum reaches 100.0 or more

Instructions

  1. Continuously ask for floating point values (decimal numbers) using the do…while() loop, sum them all up, and store the total into one variable.
  2. The loop shall only terminate for the following reasons:
  3. A negative decimal number is inputted (but still included in the total sum)
  4. The total sum reaches 100.0 or more

Input

Multiple lines containing float number on each.

1.1
1.2
1.3
1.4
-1.0

Output

A line containing a float number with two decimal places.

4.00

Create a class named Apartment that holds an apartment number, number of bedrooms, number of baths, and rent amount. Create a constructor that accepts values for each data field. Also create a get method for each field. Write an application that creates at least five Apartment objects. Then prompt a user to enter a minimum number of bedrooms required, a minimum number of baths required, and a maximum rent that the user is willing to pay. Display data for all the Apartment objects that meet the user’s criteria or an appropriate message if no such apartments are available. Save the files as Apartment.java and TestApartments.java

Even Out (JAVA)

by CodeChum Admin

You know, I was lying when I said the last time that numbers associated with 3 are my favorite, because the one I actually like the most in the world are even numbers! But to make things harder for you, you have to pick the even numbers from a range of two given numbers. Ha!

Now, let's try this one more time! 


Instructions:

  1. Input two integers in one line, separated by a space. The first integer shall represent the starting point, and the other, the ending point.
  2. Print out all even numbers that are within the range of the starting and ending point (inclusive or including the ending point).

Input

A line containing two integers separated by a space.

5·10

Output

A line containing integers separated by a space.

6·8·10

A Shorter Three (JAVA)

by CodeChum Admin

Numbers in threes are awesome! But the one last time was too lengthy to look at, so I just want to view it in a shorter but still readable format.


You okay with this task?


Instructions:

  1. Print out all numbers from 1 to 100 that is divisible by 3 using a for loop just like the last problem, but this time, with each number only separated by the space like that of the sample output.

Output

A line containing integers divisible by 3 separated by a space.

3·6·9·12·15·18·21·24...
LATEST TUTORIALS
APPROVED BY CLIENTS