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

Create a class named MyClassCircle containing a parameterized constrictor of the class and a method name getArea(l that will calculate the area of the circle. Create another class names GetAreaDemo() that will contain the main method that will supply the arguments and display its output using the standard output stream.


Traversing a Sorted Linear Array


USER INPUT THE ARRAY SIZE


Inserting Item into Sorted Linear Array


insertItem()


Get value of ITEM to be inserted.


Call findLocationInsert()


findLocationInsert()


Search for position which ITEM can be inserted and Return position


Deleting item into Sorted Linear Array


deleteItem()


Get value of ITEM to be deleted


Call findLocationDelete()


findLocationDelete()


Search for the position in which ITEM will be deleted and return position


main() - Display option similar to this:


1. Insert value 2. Delete value 3. Traverse array 4. Exit


Provide switch statement which cases for the shown options are written.


array must be checked if it's already full or not.


Enter your choice: 1


Enter element to inserted: 5


Array Basic Operations


1. Insert a value


2. Delete a value


3. Traverse the array


4. Exit


Enter your choice: 1


Enter element to inserted: 3


Array Basic Operations


1. Insert value


2. Delete value


3. Traverse array


4. Exit


Enter your choice: 3


The elements of the array: 3 5



1. A parameterized constructor taking 4 arguments for bread slices, cheese slices, meat patty number and tomato slices. The values of the rest of the variables will be initialized by default to true 2. Another parameterized constructor that takes argument for each of these variables and initializes them accordingly 3. Another parameterized constructor that takes argument for each of these variables and initializes them accordingly 4. Provide setters for mustard, ketchup, iceberg and gilled 5. Provide getters for each of these variables 6. Provide a method calculatePrice() that calculates and returns the price of this sandwich according to the rates given in the above table.


 Create a program with three methods/functions, The first one takes in n which is the size of an array then creates and populate the array with student names, the second method takes in n which is the size of an array then creates and populate n by 3 array with student marks(The three marks are for test 1 - 3) and finally a method that takes in the two arrays, calculates the final mark of all test and print out the results as indicated below: The first method should return and array of names and the second should return an array all test marks(i.e. 2d array with 3 columns). The third method in addition should also return an array for all the final marks


Create a program with a method that takes a single character and returns true if the character is a vowel otherwise return false.


Write a java program that accepts a given n, then create a 2D array with n rows and n columns. Then for each cell the value should be n+row to the power column. For example if we talk of n=5, then array[0][0] =(5+0)0  = 1. Print out all the values in the array created.


Provide a method calculatePrice() that calculates and returns the price of this sandwich

according to the rates given in the above table. E.g. the price of a sandwich with 3 bread slices, 2

cheese slices, 2 tomato slices, 3 patties, mustard, no ketchup, no ice berg with grilling will be

calculated as

3 * 20 + 2 * 30 + 2 * 5 + 3 * 70 + 5+ 0 + 0 + 10

 Provide a method applyDiscount(double disc) that calculates the price, applies the discount %

given in the argument and returns the discounted price of the sandwich.E.g. if the method is

called on a sandwich whose real price returned by the calculatePrice function is 550 and

applyDiscount(10) is called, then a ten percent discount will be calculated as 550 * 10/100 = 55.

Now this function will return the discounted price as 550 – 55 = 495. (Please note that this is just

an example, do not hard code these values in your function).


Provide a method calculatePrice() that calculates and returns the price of this sandwich according to the rates given in the above table. E.g. the price of a sandwich with 3 bread slices, 2 cheese slices, 2 tomato slices, 3 patties, mustard, no ketchup, no ice berg with grilling will be calculated as 3 * 20 + 2 * 30 + 2 * 5 + 3 * 70 + 5+ 0 + 0 + 10 . Provide a method applyDiscount(double disc) that calculates the price, applies the discount % given in the argument and returns the discounted price of the sandwich.E.g. if the method is called on a sandwich whose real price returned by the calculatePrice function is 550 and applyDiscount(10) is called, then a ten percent discount will be calculated as 550 * 10/100 = 55. Now this function will return the discounted price as 550 – 55 = 495. (Please note that this is just an example, do not hard code these values in your function).  


Provide a method calculatePrice() that calculates and returns the price of this sandwich according to the rates given in the above table. E.g. the price of a sandwich with 3 bread slices, 2 cheese slices, 2 tomato slices, 3 patties, mustard, no ketchup, no ice berg with grilling will be calculated as 3 * 20 + 2 * 30 + 2 * 5 + 3 * 70 + 5+ 0 + 0 + 10 7. Provide a method applyDiscount(double disc) that calculates the price, applies the discount % given in the argument and returns the discounted price of the sandwich.E.g. if the method is called on a sandwich whose real price returned by the calculatePrice function is 550 and applyDiscount(10) is called, then a ten percent discount will be calculated as 550 * 10/100 = 55. Now this function will return the discounted price as 550 – 55 = 495. (Please note that this is just an example, do not hard code these values in your function).  



Provide a method applyDiscount(double disc) that calculates the price, applies the discount % given in the argument and returns the discounted price of the sandwich.E.g. if the method is called on a sandwich whose real price returned by the calculatePrice function is 550 and applyDiscount(10) is called, then a ten percent discount will be calculated as 550 * 10/100 = 55. Now this function will return the discounted price as 550 – 55 = 495. (Please note that this is just an example, do not hard code these values in your function). 8. Provide the toString method that returns a well formatted string showing the detailed composition of the sandwich e.g. Bread Slices : 2 Cheese Slices : 2 Patties: 1 Tomato Slices: 0 Mustard: No (if not added) Ketchup: Yes Iceberg : Yes Grilled: No Price: Rs. 200 (dummy value given here but you will calculate programmatically and provide correct value here) 


LATEST TUTORIALS
APPROVED BY CLIENTS