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 Java program that calculates area and perimeter of square in a function. Name Calculate Area and Calculate Perimeter respectively. The values that will be passed to the functions will be first input by user.


Write a Java program that calculates area and perimeter of square in a function. Name Calculate Area and Calculate Perimeter respectively. Pass the values to the function from main () while calling functions


Write a Java program that implements a function Check Even Odd that checks that a number input by user is even or odd


Write a Java program to print odd numbers less than 20 in a function.


Make a Calculator having all the main functions using Math’s functions. 


Using a switch statement, write a program that prompts the user for a numeric code and two operands. The numeric codes of 1, 2, 3, and 4 represents addition, subtraction, multiplication, and division respectively. Before division, your program should check whether the second operand is not zero. If it is, it should display “Division by zero not allowed” to the screen.


Write a class Factors to model the factors of a integer1 à ƒ ƒ ¢ € ¢have a attribute storing the integer whose factors are to be calculated à ƒ ƒ ¢ € ¢have a boolean array attribute( factors) where each element record if that index is a factor of the integer ie factors[5] = True à ƒ ƒ ¢ € ¢have a constructor assign the stored integer attribute to a user value and create the factors array, size of this factors array? à ƒ ƒ ¢ € ¢have a method to calculate factors of stored integer and store this in mentioned Boolean array This is done by dividing the integer by the integers less than itself check for a remainder à ƒ ƒ ¢ € ¢have a method that print out the factors of stored integer to screen à ƒ ƒ ¢ € ¢have a method that takes another Factor object and prints out common factors between that object and current object. Demonstrate this class work by creating two factors objects one with a stored integer value of 28 and the other with a stored integer value of 42 Print out all and unique, common factors of both, print out if they are perfect number

Exercise

1. Create and retrieve a cookie named "username" with the value "Patience Zulu". The cookie should expire after 20 days. Check if the cookie is set and display the value of the cookie.

2. Delete the cookie from the previous question.

3. Create the file “People.php” and write a php script that will open a file for writing “WritePeople.txt” file and close the file after writing.

4. Create the file “Cars.php” and write a php script that that will open a file for reading “CarNames.txt” file and close the file after writing.


Write a class Factors to model the factors of a integer1 à ƒ ƒ ¢ € ¢have a attribute storing the integer whose factors are to be calculated à ƒ ƒ ¢ € ¢have a boolean array attribute( factors) where each element record if that index is a factor of the integer ie factors[5] = True à ƒ ƒ ¢ € ¢have a constructor assign the stored integer attribute to a user value and create the factors array, size of this factors array? à ƒ ƒ ¢ € ¢have a method to calculate factors of stored integer and store this in mentioned Boolean array This is done by dividing the integer by the integers less than itself check for a remainder à ƒ ƒ ¢ € ¢have a method that print out the factors of stored integer to screen à ƒ ƒ ¢ € ¢have a method that takes another Factor object and prints out common factors between that object and current object. Demonstrate this class work by creating two factors objects one with a stored integer value of 28 and the other with a stored integer value of 42 Print out all and unique, common factors of both, print out if they are perfect number

To qualify for an International Conference for Women in Computing (ICWC) next year in Toronto, Canada a student have got a distinction (a mark greater than 75) in PRG510S, be a female, and below the age of 25. Write a simple program that receives a mark, gender, and age from the keyboard and displays a corresponding message basing on the input.

Sample Run 1:

Mark: 70

Gender: female

Age: 21

Output1: Unfortunately you do not qualify!

Sample Run 2

Mark: 83

Gender: female

Age: 21

Output2: Congratulations! You might be in Toronto, Canada next year for ICWC!

LATEST TUTORIALS
APPROVED BY CLIENTS