Java | JSP | JSF Answers

Questions answered by 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

Hallindrome


Given a string S. Let us divide 5 into two equal parts s1 and s2.s is called a halindrome if at least any one of the following conditions satisfy:


1.Sis a palindrome and length of S>=2


2.S1 is a halindrome.


3S2 a halindrome.


In the case of an odd length string the middle element is not present in both S1 and S2. If index of middle element is m. then, S1= S [0,m-1] and S2=S[m+1|S|-1].


Input Specification


input 1: Number of strings 1<=input1<=100.

imput2:An array of size input1 containing strings 2<=length of each string<=100.

output specification:

for each test case, return the number of strings which are halindromes.

EX:input1:1

input2:{harshk}

output 0

explanation:1.string S is not forming a palindrome.

2.string S1=har,which is not a halindrome.

3.String S2=shk,which is not a halindrome.

as none of the conditions are true,hence output to be returned is 0.


please give java coding solution for this question



Write a menu driven console application for Maintaining Train Details in Southern Railway using the concept of interfaces.



a. Create an interface called IOperations and declare necessary functions such as addTrain(), editTrain(), etc.



b. Create a class called Railways which implements this interface.



c. Create a Test class which contains the main function.



d. Include functionalities such as



i. Add Train



ii. Edit Train



iii. Display All Train Details



iv. Search Train by Name



v. Search Train by


i. Add Train



ii. Edit Train



iii. Display All Train Details



iv. Search Train by Name



v. Search Train by Source & Destination



vi. Search Train by Train Number



vii. Display all the Express Train

Write a program in java to take a number as input then display highest even factors the number has using method prototype: int highest(int n)


Write a program in java to take a number as input then display the highest digit and lowest digit present in it. Use method prototype: void check(int number). The program must use 3-digit and 4-digit numbers and 1-digit and 2-digit numbers are not to be accepted.


Array is


string productitems [] = {product A,….

double prices [] = {14.00,





How to use array to add product ?

and calculate the total price ?

and get total price in the array?


Zombie Apocalypse


A patient with first stage zombie virus has escaped from the facility in a city of population N. The zombie virus is very dangerous as it passer on to other people as they come in contact with the patient making them a patient as well.


Zombie virus has K life stages to develop, each of which takes 1 unit of time. Only the last stage is contagious. A person with zombie virus attacks only healthy people and can only affect one person in 1 unit of time.


if the patient escaped on Day 1. Find out the number of days it will take to wipe out the entire city's healthy population and turn them into a last stage zombie.

Note: 1 unit of time is equal to 1 day.


Input Specification.


Input1:Total healthy population of the city.

input2:Number of stages of zombie virus.


Output Specification

your function must return the numbers of days.

Example 1:

input1:10

input2:1

output:5





please give java code for this question.


We want to calculate the total marks of each student of a class in Physics, Chemistry


and Mathematics and the average marks of the class. The number of students in the


class is entered by the user. Create a class named Marks with data members for roll


number, name and marks. Create three other classes inheriting the Marks class,


namely Physics, Chemistry and Mathematics, which are used to define marks in


individual subject of each student. Roll number of each student will be generated


automatically.



a) Write a CD class that extends the Item class. CD’s have a String artist field and an int playingTime field. This class should have appropriate constructors, getters and setters and should override the toString method and the depreciate method. CD’s depreciate by 10%. b) Write a DVD class that extends the Item class. The DVD class has a String director (the director of the movie) and an int runningTime (how long the movie is). Remember to provide the appropriate constructors, getters and setters and to override the toString method and the depreciate method. DVD’s depreciate by 15%


Write JSP programs which can perform the following tasks: (you may create a single or multiple web pages for these tasks): (i) A page requires input of three variables a, b, and c, it then finds and displays the largest of these three variables. Write the JSP code for the above. (ii) Create a login page for students which should create two cookies namely userID and password on successful login by a student.




The Super-class Write a class called Item. The Item class represents all that is common between various multimedia items. It should have the following attributes (fields): a) a String name to store the name of the item. b) a String comment to store a comment about the item. c) a double value to store how much the item cost. It should have appropriate constructors and at least the following methods a) getters and setters for the attributes. b) a public String toString() method that returns a String representation of the Item. c) a method void depreciate() that decreases the value of the item by 5%.


LATEST TUTORIALS
APPROVED BY CLIENTS