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

Write a class named Pet,which should have the following data attributes:

a.__name(for the name of a pet)

__animal_type(for the type of animal that a pet is.Example values are ‘Dog’,

‘Cat’,and ‘Bird’)

__age(for the pet’s age)

The Pet class should have an__init__method that creates these attributes.

It should also have the following methods:

b.set_name:This method assigns a value to the__name field.

set_animal_type:This method assigns a value to the__animal_type field.

set_age:This method assigns a value to the__age field.

get_name:This method returns the value ofthe__name field.

get_animal_type:This method returns the value of the__animal_type field.

get_age:This method returns the value of the__age field.


3.Write an Employee class that keeps data attributes for the following pieces of

information:

a.Employee name

b.Employee number

Next,write a class named ProductionWorker that is a subclass of the Employee class.

The Production Worker class should keep data attributes for the following information:

c.Shiftnumber(an integer,such as 1 for morning shift,2 for evening shift)

d.Hourly payrate

Write the appropriate accessor and mutator methods for each class.


The organisation you work for has asked you to create an interactive application that will assist with the allocation of employees to a cell phone network provider and phone number generation. You are required to prompt a user for three employee names which will randomly assign the employee to either the Vodacom, MTN or Cell C network. The employees also require a randomly generated phone number. The start of each phone number will begin with the following, depending on the network provider: NETWORK PROVIDER START Vodacom 072 MTN 083 Cell C 084 The remaining numbers of the phone number must be randomly generated.


“Gola Ganda” shop, Gola Gandas of all shapes and sizes. Gola gandas of three sizes: Small, Medium and Large.

A customer can add as many toppings on it as they want, the toppings could be more “Sauce”, Condensed Milk, Nutella, etc . Every topping has a different cost, and the cost of each topping will be added on top of the cost of the size of gola ganda.

if a small gola ganda cost, 50 rupees, and a topping of condensed milk cost 10 rupees, and a topping of Nutella cost 20 rupees, and if a customer has ordered a small gola ganda with condensed milk and Nutella then the total cost will be 80 rupees (50 for small gola ganda, 10 for condensed milk, and 20 for Nutella).

Your job is to design a system that can calculate the final cost of the gola ganda.

task is the following:

• Identify the design pattern that can be used over here

• Justify your choice

• Make a class diagram (using UML Notation)

• Implement the classes in JAVA

• Test your implementation


Suppose you are employed by a advertisement agency to design a system to send advertisements in different languages and to different modes such as sms, email, in-mail, cable-tv, etc. (more can be added later or).

The process of sending an advertisement is always the same irrespective of the language or the mode of the advertisement. The process is as follows:

1. The text of the advertisement is received as text

2. The text is then translated into a desired language.

3. The translation depends upon the mode of advertisement

4. The translated text is then proof-read for consistency

5. And then the text is advertised on the required mode

Your task is the following:

• Identify the design pattern that can be used over here

• Justify your choice

• Make a class diagram (using UML Notation)

• Implement the classes in JAVA

• Test your implementation



Design a class named Person and its two subclasses named Student and Employee. Make Faculty and Staff subclasses of Employee.


(The Person, Student, Employee, Faculty, and Staff classes)


A person has a name, address, phone number, and email address. A student has a class status (freshman, sophomore, junior, or senior). Define the status as a constant. An employee has an office, salary, and date hired. A faculty member has office hours and a rank. A staff member has a title. Override the toString method in each class to display the class name and the person’s name.


Write a test program that creates a Person, Student, Employee, Faculty, and Staff, and invokes their toString() methods.


Write a java Program considering the following scenario.


•Mobile is an Object that contains basic functionalities including Calling & Receiving a call & Messaging. The Mobile has certain features including Processor, internal memory, single or dual SIM, weight. The IMEI number is only used for identifying the device.


•There can be different mobiles like Samsung, iPhone or Nokia which have their own features along with the basic functionality of a mobile phone.


•In case of Samsung, the Android version, Camera Specs and playing FM Radio, capturing photos.


•iPhone may have an ios version, Music Player, Camera.


•Any of these mobile phones can be used to make a call or send a text message.


Write a simple java program that adds two integers input by user. The program should terminate if any operand is nonnumeric. Before program exit, a message should be displayed that “Input is not valid!”.


Hint: You can use


–NumberFormatException


–InputMismatchException


--ClasscastExcception



https://www.chegg.com/homework-help/questions-and-answers/question-2-marks-20-organisation-work-asked-create-interactive-application-assist-allocati-q74111994


Create a class named MusicalComposition that contains fields for title, composer, and year

written. Include a constructor that requires all three values and an appropriate display function.

The child class NationalAnthem contains an additional field that holds the name of the

anthem’s nation. The child class constructor requires a value for this additional field. The child

class also contains a display function. Write a main() function in class MusicDemo that

instantiates objects of each class and demonstrates that the functions work correctly.


LATEST TUTORIALS
APPROVED BY CLIENTS