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
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:
Input
The first line contains an odd positive integer.
The next lines contains an integer.
5
1
3
4
5
2Output
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
2Output
A line containing a string.
PresentWrite 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
entered in the array