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

Instruction:

Create a Java Program that will accept two values.

Determine if the two argument lists are identical or not.

Sample IO #1:

Sample Input:

Name1: Jose

Birthday: 1-1-2000

Name2: Jose

Birthday: 1-1-2000

Output:

IDENTICAL

Name: Jose

BirthDate: 1-1-2000

Name: Jose

BirthDate: 1-1-2000


Sample IO #2:

Sample Input:

Name1: Jose

Birthday: 1-1-2000

Name2: Jose

Birthday: 6-7-2012

Output:


NOT IDENTICAL

Name: Jose

BirthDate: 7-6-2000

Name: Jose

BirthDate: 6-7-2012


MyDate Class


Attribute/s: private int day, month, year;

Constructor/s:

public MyDate(int month, int day, int year)


Method/s:

Setters and getters, public boolean equals(Object o);

public int hashCode(); and

public String toString()


Person Class

Attribute/s: private String name; private MyDate dob;

Constructor/s:

public Person(String name, MyDate dob)

Method/s: Setters and getters,

public boolean equals(Object o);

public int hashCode(); and

public String toString()




Your Test class named TestPerson


1.3. A retail Shop has a functionality to add item into the stock list. The add item takes a parameter 

the Item to be added on stock. [2]

1.4 A retail shop also has a functionality to calculate total sales that returns double sum of money 

made from all sold items. [2]


Organising Item storage in the computer can assist in ensuring that the Items that were stored in the



stock item list first are the first to be taken out. This will ensure that older stock is sold first. Conduct



some research on what data structure you can use in the storage of Item in the retail shop instead of



using a list.



2.1 Change the storage List of the Items in the Retail Shop so that the item stored first are the items



removed first when items are sold

1.5 A retail shop have functionality to sell. The sell function must take item name, and size as a 

parameter. Removes the item from the stock and put that Item in the sold list. The sell function also 

displays the sold item details, name, size, and days before expiry date. [2]

If item is not available in the stock a message must be displayed on the screen “no stock”;

1.6 An Items class need to be created in order to implement a complete Retail Shop. All items MUST/ 

FORCED to have the getPrice() function returns price of an item , setPrice(double price), returns 

nothing, but set a price of an Item. [2]


A Retail has name, a List containing Items available in the stock and another List containing sold 

items. [2]

1.2 A Retail have functionality to view available stock, that prints Class name of item, name of Item, 

size of item and total number of items that have same name, and size. [5]

EXAMPLE 

ClassName Item name Size Total

Drink coke 1 10; // this show that in the list there are 10 coke that are size of 1

Drink coke 2 5; // this show that in the list there are 5 coke that are size 2

Sizes in drinks means litres.

Hint: Items are the same if their class name, item name and size are the same.

1.3. A retail Shop has a functionality to add item into the stock list. The add item takes a parameter 

the Item to be added on stock. [2]

1.4 A retail shop also has a functionality to calculate total sales that returns double sum of money 

made from all sold items. [2]



Don't you guys have other examples of the same questions but different answers instead of a academic institution


Create a java program that will count all words in a sentence.THe program should have a minimum of two classes


Write a program to receive ten floating points value,store them in an array. Then calculate and display their average.

Program in Java


PROGRAM DESIGN

Create a class Date that can perform the following operations on a date:

- Set/Return the Month

- Set/Return the Day

- Set/Return the Year

- Whether the year is a leap year.

if the year number isn't divisible by 4, it is a common year;

otherwise, if the year number isn't divisible by 100, it is a leap year;

otherwise, if the year number isn't divisible by 400, it is a common year;

otherwise, it is a leap year.

- Return the number of days in a month

April, June, September, November has 30 days otherwise 31 except for Feb (refer to leap year)

- Print the month in string format followed by the date and year


SAMPLE INPUT1

2020

2

15

SAMPLE OUTPUT1

February 15, 2020

29 days

2020 is a Leap Year


SAMPLE INPUT2

2019

2

29

SAMPLE OUTPUT2

Invalid number of days


SAMPLE INPUT3

2019

3

15

SAMPLE OUTPUT3

March 15, 2019

31 days

2019 is a Common Year





Create an Application JFrame contains four JPanel and 12 Buttons that each display a single spell out number.JFrame is assigned a BorderLayout, and each JPanel is assigned either a GRidLayout of FlowLayout and placed in one of the regions(Leaving the north region empty).One or more JButtons are then placed on each JPanel.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS