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 superclass class Employee with this:

-A name and salary instance variables

-A constructor that receives values to set the values of the instance variables

-To String method that returns the name along with the salary as a String


Create a class Manager that inherits from Employee with the following:

-Add an instance variable, named department, of type String.

-A constructor that receives the values of name, salary, and department and set them properly

-Supply a method toString that returns the manager’s name, department, and salary.

 

Create a class Executive that inherits from the Manager with the following:

-A constructor that receives the values of name, salary, and department and set them properly

-toString method that returns the manager’s name, department, and the salary he

 

Create a class that contains the main method with the following

-Create an object of each Employee, Manager, and Executive properly

-Display the returned value of calling the toString methods for each of the created objects


Write a program to create 2 single dimension 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.

Use only java.util.* package

The output of the program must be like below:

Enter 5 numbers for first array

34 57 879 21 9

Enter 6 numbers for second array

12 3 4567 23 31 98

Values of first array from left to right followed by second array again from left to right

34 57 879 21 9

12 3 4567 23 31 98

Values of merged array

34 57 879 21 9 12 3 4567 23 31 98


Give the following list: B E A D C F H G


Apply selection sort AND merge sort to sort the list in ascending order. Show all the insertion steps for each data.


Consider the following list of numbers:


1 7 8 14 20 42 55 67 78 101 112 122 170 179 190


Apple binary search algorithms in order to find the target keys which are number 42 and number 82. Show your steps and calculate the total number of comparisons for each items.


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 array.


import java.util.*;

class A {

public static void main(String args[]) {

Scanner sc = new Scanner(System.in);

int a[] = new int[5];

int b[] = new int[6];

int i,n,m,p;

System.out.println("Enter numbers in first array");

n = sc.nextInt();

System.out.println("Enter numbers in second array");

m = sc.nextInt();

Continue from here: merging values of both arrays into third array and then displaying values of the first array in first from left to right followed by values of second array again from left to right & then values of the merged array.


Develop a java console application that either overhaul or automate it

Using Loop Statement, create a program that will be able to display student information such as, last name, first name, middle name, address, contact number, date of birth: mm/dd/yyyy.




1. Create a folder named LastName_FirstName in your local drive. (ex. Reyes_Mark)


2. Using NetBeans, create a Java project named MovieTime. Set the project location to your own


folder.


3. Import Scanner, Queue, and LinkedList from the java.util package.


4. Create two (2) Queue objects named movies and snacks.


5. The output shall:


5.1.Ask the user to input three (3) movies that s/he would like to watch in a cinema.


5.2.Ask the user to input three (3) snacks or beverages that s/he would like to eat or drink while


watching these movies.


5.3.Display all the movies and snacks in separate lines.


5.4.Ask the user to type S whenever s/he is done eating or drinking a snack.


5.5.Display the snacks remaining each time S is pressed and "No more snacks" when all snacks


are eaten.


6. Convert your code into a Python script.


7. Save the script as movie_time.py to your folder.



1. Create a folder named LastName_FirstName in your local drive. (ex. Reyes_Mark)


2. Using NetBeans, create a Java project named StudentList. Set the project location to your own


folder.


3. Import Scanner, Map, and HashMap from the java.util package.


4. Create an empty hash map named students.


5. The output shall:


5.1. Ask three (3) of your classmates to enter their student number (key) and first name (value).


5.2. Display the keys and values of the map.


5.3. Delete the mapping of the third entry.


5.4. Enter your student number and first name. This would be the new third entry.


5.5. Display the entries in separate lines.


6. Create a Python script that meets the same specifications. Feel free to use lists to store input.


7. Save the script as student_list.py to your folder.



Program Name: MyBookList.java [20]



You are being asked to write a program which will keep the list of books. The program will keep record for



the book’s title, price, and pages. You are required to use the two-dimensional String



array for this purpose.



The array would have n rows and 3 columns where n is the size entered by user. The first, second,



and third columns would be used for storing a book’s title, price and pages respectively. We will also treat



price and pages as a String. This array should be of this form:



Introduction to AI 1200.00 450



Reinforcement Learning 1300.99 1000



Deep Learning: Practical 1575.60 850

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS