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

· Declare an array as Car with size 10.

· Take 10 Car’s information from user and store them in specified array.

· Call findCarList method from Main class to get all cars information related to a given model name and display then within this method.

· Model name should be taken from Main class and pass to findCarList method as argument as well as Car array (with size 10).

Design findCarList method in Car classas follows:

· it will take a model(car model) as parameter and array of cars (with size 10)

· displays List of cars for the given model from the list .

· If there are no cars, then shows “No cars found”.


How to determine the set is symmetric using java code?


How to determine the set symmetric when user input the set using java code?



Write a program to take a String as input then display the words in one column, number of characters in each word in second column and the first letter of each word in third column with appropriate heading.

For example:

Enter a String

Hello world

Words Length First Letter

Hello 5 H

world 5 w


Task #6: String, Methods and File I/O

In this task, you are being asked to write void methods that manipulate String, and write and read 

to and from the text file in Java.

Write a method called replaceSpacesWithDots() that accepts one String argument, and 

return the String after replacing all spaces in the String with dots.

You may use the following header for this method:

static String replaceSpacesWithDots(String sentence)

For example, if you read “The quick brown fox jumps over the lazy dog” from

the file, then the method should write

“The.quick.brown.fox.jumps.over.the.lazy.dog” to the output file.

NOTE: Read the input from the input-6-3.txt file.

 Write the output to the output-6-3.txt file.

1. Create a program called FileIOStringReplaceLab3.java

2. Correctly write the output with appropriate messages.


Task #4: Arrays, Methods and File I/O

2. Write another method called getSecondLargestNumber that accepts an integer array 

as argument and returns the second largest number from the array.

You may use the following header for this method:

static int getSecondLargestNumber(int[] array)

For example, if we pass {10, 17, 3, 5, 12, 19} then the method should return 

17 as the second largest number from the array.

NOTE: Read the input from the input-4-3.txt file.

 Write the output to the output-4-3.txt file.

 Write the second smallest and then the second largest number from that array.

1. Create a program called FileIOSecondSmallestLargestLab3.java. 

2. Correctly write the output with appropriate messages..


Task #4: Arrays, Methods and File I/O


In this task, you are being asked to write methods that manipulate arrays, and write and read to


and from the text file in Java.


1. Write a method called getSecondSmallestNumber that accepts an integer array as


argument and returns the second smallest number from the array.


You may use the following header for this method:


static int getSecondSmallestNumber(int[] array)


For example, if we pass {10, 17, 3, 5, 12, 19} then the method should return 5


as the second smallest number from the array.

Arrays, Methods and File I/O


In this task, you are being asked to write methods that manipulate arrays, and write and read to


and from the text file in Java.


Write a method called getFirstRepeatingNumber that accepts one integer array as


argument and returns the first repeating number from the array.


For example, if we pass {3, 5, 6, 2, 7, 9, 8, 11, 6, 12} then the method should


return 6 as the first repeating element from the array. If all the elements are unique, then the method


should return -1.


You may use the following header for this method:


static int getFirstRepeatingNumber(int[] array)


Declare and initialize the array and write the first repeating number from that array in the output file. If there is no repeating element in the array, then you would write “All elements are unique”by a test in the main method.


Read the input from the input-3-3.txt file.


Write the output to the output-3-3.txt file.


Create a program called FileIOFirstRepeatingNumberLab3.java.

How To Test Whether a Set is Reflexive, Symmetric, Anti-Symmetric and/or Transitive?



Write a program that calculates and prints the product of FIVE integers.

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS