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

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!


Input


The first line contains the size of the array/list.

The next lines contain the integers.

The last line contains an integer to be searched.


5

3

21

2

5

23

2

Output


A line containing a string.


Present


Groupings

by CodeChum Admin

Did you know that you can also reverse lists and group them according to your liking with proper code? Let's try it to believe it.


Instructions:

  1. Create a variable that accepts a positive odd integer.
  2. 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 odd integer on the first instruction.
  3. Reverse the order of the list. Then, print out the list's new order in this manner:
  4. [first-half values]-[middle value]-[second-half values], just like that of the sample output. Make use of list slicing that you’ve learned from the past lessons to easily achieve this segment.

Input

The first line contains an odd positive integer.

The next lines contains an integer.

5
1
3
4
5
2

Output

A line containing a list without space.

[2,5]-[4]-[3,1]




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!


Input

The first line contains the size of the array/list.

The next lines contain the integers.

The last line contains an integer to be searched.

5
3
21
2
5
23
2

Output

A line containing a string.

Present

 Write a Java program that asks the user to enter an integer number N and successively display all the odd numbers that are less than or equal to N.

 Improve the program so that it also displays the number of odd numbers

less than or equal to N.



Initialize two (2) variables to hold the employee name and the gross pay (amount before deductions). See sample output below.


Employee Name: Jess Diaz

Gross Pay: 25000.0

_________________________

Deductions Amount

Witholding Tax 3750.0

SSS Contributions: 907.5

Medicare: 312.5

Pagibig Contribution: 100.0

__________________________

Net Pay: 19930.0




Write a Java program that calculates and prints the monthly pay for an employee. The net pay is calculated after taking the following deductions:




Withholding Tax 15%



SSS Contribution 3.63%



Medicare 1.25%



Pag-IBIG PHP 100.00

Create interface Car: two methods getName () returns the car name, getPrice () method returns the car price

Create class BMW to implementation interface Car returns the name and price of BMW

Create class Maruti car to implement the interface Car returns the name and price of Maruti.

Create CarShop class: private member variable money is used to store the total income. 

 The member method sellCar has no return value and has a parameter, and the parameter is the Car interface. 

The member method completes the function: 

1. Output model: car name , get car price; 

2. Cumulative total revenue money value



Create the main class: create an automobile sales shop object. Create BMW objects, Maruti objects

 Call the sellCar method to sell the car. Output the total revenue of the sales shop.



create a parent class "Account" with three variables num, title and bal with two functions withdraw and deposit. Create a child class "Saving Account" with a function calculate Profit (that applies 7.5% profit on current balance). Finally create the class "TestApp" that creates the object of saving account and call withdraw, deposit functions and public data memebers of account clas. Override withdraw function in savingAccount to deduct Rs:250 if the balance after withdrawal of amount is less than 10000. In javascript


Develop a system by using Java programming language and object-oriented programming concepts for a hotel room reservation system. It should be a menu-driven stand-alone console application (No GUI required). No need to connect any database as well, but you may use file operations if required (not mandatory). Your system must have the following functionalities

o Register guests

o View available rooms

o Allocate a room for a guest

o Change/ delete room allocation for a guest

o Check-in to a room

o Checkout from a room

o Generate the bill


  •  Create a public class Student that has: o three private attributes:
  • name (String)
  •  an array of grades (array of integers).
  • finalGrade (float) which contains the average of the grades

entered in the array

  • The following public methods:
  •  A constructor allowing only to initialize the name of the student.
  •  A setter for the attribute name
  •  A method void addGrade(int nbr) in which nbr is the size
  • of the array. The method should ask the user to enter the grades and then computes the average (finalGrade) without displaying it.
  •  A method String toString() that returns the a String in the following format:
  • Name of the student: name Final grade: finalGrade
  •  Create a test class Test in which you:
  •  Create an instance of the class Student
  •  Change the name of your Student instance o Invoke the addGrade(int nbr) method
  •  Invoke the toString() method.
LATEST TUTORIALS
APPROVED BY CLIENTS