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

Find latitude and longitude of utmost 20 countries, ordered by population, with a population greater or equal to the population limit given below and have atleast one currency exclusively for themselves. (countries like Madagascar, Sri Lanka but not India, USA). Use the country details from this dataset.

Your task is to find the sum of the length of all lines (in kms) that can be drawn between co-ordinates of these countries.

  • Assume radius of earth: 6371 km
  • Round length of each line and final result to 2 decimal points
  • If co-ordinates are missing for any country use 0.000 N 0.000 E

Population limit: 20792

Write a program to create 2 arrays in order to store 5 numbers and 6 numbers respectively. Then merge those values of both the array into third array so that the values of the first array will be kept first from left to right followed by values of second array again from left to right. Then display those values of the merged(third) array.


Implement an application (a system) of any abstract data type (stack, queue,


tree, graph, hashing) using Java as programming


language. Some of the examples are the following:


• Dictionary implementation using AVL Tree


• Log-book for Task Monitoring


• Queuing System for Clinics

Write a program to create a single dimension array to store marks of 25 students. Then display the highest mark and also display how many students got the same highest mark.


import java.util.*;

class Marks {

public static void main(String args[]) {

Scanner sc = new Scanner(System.in);

int a[] = new int[25];

int i; //loop

int j, d; //swapping elements sorting

int c=0; //To frequency

System.out.println("Enter marks of 25 students");

for (i = 0; i < 25; i++) {

a[i] = sc.nextInt();

}

// Stored 25 marks in an array

for (i = 0; i < 24; i++) {

for (j = 0; j < 24 - i; j++) {

if (a[j] < a[j + 1]) {

d = a[j];

a[j] = a[j + 1];

a[j + 1] = d;

// Elements swapped in descending order

}

}

}

Continue from here to: Find the highest marks and frequency of those students.


Write a program that read data.txt as input file. Then print student's name who scored 60 and below. Count and display students who scored A


Ahmad
90
A
Ali
80
B
Siti
70
B
Abu
47
E
Aminah
98
A
Noraini
40
E
Anuar
50
C
Zaid
52
C

The colors red, blue, and yellow are known as the primary colors because they cannot be made by mixing other colors. When you mix two primary colors, you get a secondary color:  When you mix red and blue, you get purple.  When you mix red and yellow, you get orange.  When you mix blue and yellow, you get green. Design a program that prompts the user to enter the names of two primary colors, one at a time. If the user enters anything other than "red," "blue," or "yellow," the program should print "You didn't input two primary colors." Otherwise, it should print something in the format: "When you mix red and blue, you get purple." (Assuming the user entered "red" and "blue”.)


Write a program to implement Eratosthenes Sieve. The program should ask the user for an upper bound and should then print all the prime numbers less than or equal to that upper bound. In your program, use a boolean array to maintain a record of the numbers that are possible primes.

The output should have eight values per line with each value right-justified in a field that is ten characters wide. You may find the methods of the Out class shown in Appendix A useful for this.

Number 1which can be found on http://ntci.on.ca/compsci/java/ch8/8_7.html


Question is found on the link http://ntci.on.ca/compsci/java/ch8/8_7.html --> question 11

Please make the code simply use arrays and no import.java


My cousin recommend this to me, please answer for free and don't let me down, appreciate it your free help.


Task #7: Arrays and Methods


In this task, you are being asked to write methods that manipulate arrays in Java.


Write a method called sumOfArrays which will take two integer arrays as argument and


return an integer array having the sum of these two arrays.


You may use the following header for this method:


public static int[] sumOfArrays(int[] arrayA, int[] arrayB)


For example, if we pass {2, 4, 9, 12, 15, 5} and {7, 4, 3, 6, 2, 9} to this


method, then the method should return {9, 8, 12, 18, 17, 14} as an integer array.


NOTE: Declare and initialize the array without taking input from user.


1. Create a program called SumArraysLab2.java.


2. Correctly display appropriate messages.

Task #4: Arrays and Methods

In this task, you are being asked to write a method that manipulates arrays in Java.

Write a method called printUnique that accepts one integer array as argument, and

print all unique elements form the array.

You may use the following header for this method:

static void printUnique(int[] array)

For example, if you pass {2, 4, 2, 15, 4, 5, 6, 9, 12, 2} to this method, then

the method should print 15, 5, 6, 9, 12 as unique elements.

NOTE: Declare and initialize the array without taking input from user.

1. Create a program called ArrayPrintUniqueLab2.java.

2. Correctly display appropriate messages.