Implement your own version of queue data structure using java with OOPs principles mentioned functionalities: enqueue, Dequeue , peek, contains, size, center, sort reverse, iterator, traverse/print.
Use of similar data structures already present in the language/framework is not allowed.
1) Write a program that accepts the amount of money deposited in a bank account, the annual interest rate and the target amount (The amount of money the account holder wants to have in the account after a period of time) and then calculates the number of years it will take for the money to accumulate to the targeted amount. NB: 1) The interest being earned is Compound Interest. 2) Don’t use the formula for calculating compound interest.
For example if the money deposited is 10000 and the target amount is 20000 and the account earns an interest rate (compound) of 10% pa, then the output should be: -
It will take 8 years for your money to reach your target.
By the end of this period, the amount in your account will be 21435.89
Bookong List Programming--developer needs to input the following information from the console using programming to view the booked ticket history for a passenger.
*passenger id: a 7 digit number for passenger id for whom booking is to be done.
*on submitting the passenger id,the console shows rows with columns populated from inserted array/list/appropriate collections; PNR NO|Travel date| source|destination|Seat preference|Meal preference
ticket booking programming;--Developer needs to input the following from the console using programming to book ticket for a passenger:
-passenger id:a 7 digit number for passenger id for whom booking is to be done.
-pnr no:a string field for pnr no with a default 7 digit number.
-travel date:a string field to enter the journey date in format(dd/mm/yyyy).
-source:a string field to capture the source airport.
-destination:a string field to capture the destination airport.
-status:a string field to select among following values new/confirm/hold.
-seat preference:a string field to select among following values,middle,aisle.
-meal preference:a string field to select among following values.
**once all fields are taken input,booking details need to be inserted in array/list/appropriate collection.after successful booking,a booking acknowledgment message need to be displayed on the console as "ticket booked successfully,Happy Journey...".
developer needs to input the following information from the console using programming to register passenger:passenger id:a random 7 digit number for passenger id with a default value;....passenger name:a string field for passenger name(maximum 50 characters);....email:a string field to capture the email;....password:a string field for password(maximum 30 characters);....Address:a string field to capture street,city details(maximum 100 characters);...Contact number:text field(maximum 10 characters);....once all fields are taken as input,passenger details need to be inserted in array/list/appropiate collection.after successful registration,a registration acknowledgment message need to be displayed on the console as "passenger registration is successfull".
1) Write a program that accepts a set of integers (the user decides how many) and then stores them in an array. The main function then passes these values one by one to a method called get_even which returns 1 if the integer is even and 0 if it is odd. The main function should then specify which numbers were even, which ones were odd and their respective totals. It should also specify how many numbers were odd and how many were even. For example, if the user enters 25 34 56 17 14 20, the output should be: -
25 is an odd number
34 is an even number
56 is an even number
17 is an odd number
14 is an even number
20 is an even number
There is a total of 2 odd numbers and their sum is 42.
There is a total of 4 even numbers and their sum is 124.
NB: All data input and output should be done in main. Don’t use % any where in the main function (% can be used in the method).
6. Write a Java program that will print the following series until it reaches 100.
1 1 2 3 5 8 13 …………………………
7. Write a java program to find the sum of the series up to the nth term where n is input by the user.
1+(1+n)+(1+n+n)+(1+n+n+n)……………….nth Term
Example: input n = 6
Output: 1+7+13+19+25+31 = 96
4. Write a program (without using an array) that accepts three numbers from the user and prints "increasing" if the numbers are in increasing order, "decreasing" if the numbers are in decreasing order, and "Neither increasing or decreasing order" otherwise.
Example: Input first number: 1524
Input second number: 2345
Input third number: 3321
Expected Output :
Increasing order
5. Write a java program that inputs an integer and outputs if the number is a Palindrome.
2. Write a program in Java to display a diamond pattern of asterisks.
Expected Output :
*
***
*****
*******
*********
***********
*************
***********
*********
*******
*****
***
*
3. Write a Java program that reads a positive integer and counts the number of digits the number has.
e.g. Input is 14367, Output is 5.
1. Write a program in Java to display a right-angled triangle pattern with numbers, as shown below.
Expected Output :
1
12
123
1234
12345
123456
1234567
12345678
123456789
12345678910