Java | JSP | JSF Answers

Questions answered by Experts: 3 611

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

  1. Using this Online IDE, create three (3) linked lists named songs, artists, and playlist. You may refer to the sample codes in this module. 
  2. Add five (5) song titles to the first linked list then add the five (5) singers/bands of those songs to the second linked list.
  3. Combine the first two (2) linked lists and add each combination to the third linked list, which is playlist.
  4. Display the content of the three (3) linked lists in separate lines. See sample output below.

Instructions

  1. Create a variable that accepts a positive integer.
  2. Create an empty array. Then, using loops, add random integer values into the array one by one. The number of values to be stored is dependent on the inputted positive integer given in the first instruction.
  3. Print out the largest integer among all the elements in the array, by any means necessary.


Input

The first line contains the size of the array/list.

The next lines contains an integer on each.

5
5
34
3
23
10

Output

A line containing an integer.

34

Implementation of Stack ADT Operations using Array

Encode the given source code and provide the needed statements which will complete the program.

1. Take note of the following:

• push() is a method that will insert an element at the top of the stack

• pop () is a method that will delete the top of the stack

• peek() is a method that will return the top of the stack

2. Include the following push operations in your code, specifically in the main method:

• push(10)

• push(23)

• push(4)

• push(36)

• push(12)


After compiling and running your code, it is expected that the sample output below will display in your screen.


My Stack Operations

1. Size of stack after push operations: 5

2. Top of the Stack: 12

3. Pop elements from stack : 12 36 4 23 10

4. Size of stack after pop operations : 0





Develop a Java GUI application that will display the petrol cost per litre for three different cities with a time span of three years. Q.1.1 On the form create a list box, to allow a user to select between three different cities. Also create a combo box for the user to select the year. Finally add a submit button. Once the user has selected a city, year and clicked the submit button display the petrol price per litre for that year. Use the following table for the city and yearly petrol prices per litre:


Write a Java application and use a Two dimensional array to store five Dutch, French and Italian



translated words. Use a single array to store the English words.



Your program must:



Q.2.1 Contain a single array to contain the following five English words and a Two



dimensional array to store the following Dutch, French and Italian translated words.



ENGLISH WORD DUTCH WORD FRENCH WORD ITALIAN WORD



sky hemel ciel cielo



run rennen courir correre



study studie etude studia



music muziek musique musica



dog hond chien can

Write a Java application and use a Two dimensional array to store five Dutch, French and Italian


translated words. Use a single array to store the English words.


Your program must:


Q.2.1 Contain a single array to contain the following five English words and a Two


dimensional array to store the following Dutch, French and Italian translated words.


ENGLISH WORD DUTCH WORD FRENCH WORD ITALIAN WORD


sky hemel ciel cielo


run rennen courir correre


study studie etude studia


music muziek musique musica


dog hond chien can

Write a Java application and use a Two dimensional array to store five Dutch, French and Italian translated words. Use a single array to store the English words.



Q.2.1 Contain a single array to contain the following five English words and a Two dimensional array to store the following Dutch, French and Italian translated words.



ITALIAN WORD



cielo



correre



studia



musica



cane



ciel



courir



etude



musique



chien



hemel



rennen



studie



muziek



hond



FRENCH WORD



Your program must:



ENGLISH WORD



sky



study



music



run



dog



DUTCH WORD



Build a class Department having id (int), address (String) and projects (array list of projects) and workers (array list of workers) a. Provide parameterized constructor Department (String address) which initialized id randomly and array lists as empty array lists. Provide in department class void addProjectWork(int pid, int wide, int hours)

This will add the hours to the worker of the given project. For this you will need to call the appropriate method of the project class i.e addMemberHours which adds the hours for the specified member as well as add to duration of the project


Build a class Project with id(int) , desc (String), duration (int) , budget (double) and members (ArrayList of Workers). a. Provide a parameterized constructor Project (int id, String desc, double budget). The member array will be initialized as empty array and the initial duration of the project will be 0 b. Provide setters for description and budget and getters for all except members list. Provide a method getTotalCost() that calculates the total cost of the project by summing the budget and the salary of each member of the project. The salary of each m ember can be found by calculating an appropriate method of the Worker class.


Build a class Project with id(int) , desc (String), duration (int) , budget (double) and members (ArrayList of Workers). Provide a parameterized constructor Project (int id, String desc, double budget). The member array will be initialized as empty array and the initial duration of the project will be 0 b. Provide setters for description and budget and getters for all except members list

 Provide a method getTotalCost() that calculates the total cost of the project by summing the budget and the salary of each member of the project. The salary of each member can be found by calculating an appropriate method of the Worker class .


LATEST TUTORIALS
APPROVED BY CLIENTS