Write a program in java to store 100 to 150 in a Single dimension array then display all even numbers in one line in ascending order and all odd numbers in next line in descending order with appropriate heading as follows:
Even numbers are-
100 102 104 106 ...
Odd numbers are-
149 147 145 143 ...
Explain with the help of an example/diagram or write code for the following using JSP:
a) JSP life cycle.
b) Need of Directives in JSP with the help of taglib directive.
c) Use of scriptlet with the help of an example on displaying a number series from 1 to 10
d) The role of action elements in JSP with the help of an example of <jsp:usebean)
e) The purpose of using implicit objects in JSP with the help of an example.
Create a Class User having following data members
Name (String)
Phone (String) T
Address (Address Class) -> Perform Dependency Injection
Team (Team Class) -> Perform Dependency Injection
Address Class have following data members
Address Line 1 (String)
Address Line 2 (String)
City (String)
State (String)
PINCODE (Integer)
Team Class have following data
Team Name (String) >> To be taken from properties file
Number of members (Integer) >> To be taken from properties file
Project (Project Class) -> Dependency Injections
Project Class have following Data
List of Sub Projects (Array List)
Implement the same using Spring 5 Annotation and XML Approaches
Create Beans for multiple employees and fetch the same in the Main Class.
Note: Create two different projects one for Annotations Based Approach and other for XML based approach.In this assignment, you will again modify your Quiz program from the previous assignment. You will replace the text based dialog boxes with button-based dialog boxes specialized for multiplechoice and true-false questions. This assignment uses many classes and methods described in Chapter 6 of Eck (2019), and the instructions below include references to the relevant sections of Chapter 6. First, modify your main program for easier testing. • Open your "CS1102" project in Eclipse. • Bring up "Quiz.java" in the editor pane. • Use "/*" and "*/" to comment out all your questions except one true/false question. •
}
Exercise:
Design a Transportation class:
1. Super class included all class instances (CarModel, CarType,
CarName…etc)
2. Subclass calls the superclass and overridden methods of
superclass. (the methods in superclass as you like).
3. Don’t re-define the class instance in the subclass.
4. Modify the overridden method in the subclass.
1 Context The state pattern is a behavioral software design pattern that allows an object to alter its behavior when its internal state changes.
2 Problem description In this example, a Hero can be in one of the 3 states: ALIVE, DEAD, INVISIBLE, SILENCED defined in HeroContext. When a Hero is ALIVE with hp0, it can attack, and can be attacked, silenced and disappear. When attacked, its hp is decreased by damage. If hp=0, a Hero enters the state of DEAD with hp=0. When silenced, a Hero enters the state of SILENCED. When disappear, a Hero enters the state of INVISIBLE. When a Hero is DEAD with hp=0, it can be revived. When revived, a Hero enters the state of ALIVE with full hp. When a Hero is SILENCED, it can be attacked, recovered and disappear. When attacked, its hp is decreased by damage. If hp¡=0, a Hero enters the state of DEAD with hp=0. When recovered, a Hero enters the state of ALIVE. When disappear, a Hero enters the state of INVISIBLE. When a Hero is INVISIBLE, it can appear.
2. Write a simple java application that will declare the class shown in the UML diagram below.
- The getAge() method should calculate and return the present age of a person. Hint:
Use dob (date of birth). The printDetails() method should display the full name of
the person together with the gender and age in separate lines.
- Create two objects from this class. Initialize the first one with the first constructor
and, the second one with the second constructor. Use the setGender() and setDob()
methods to initialize the gender and dob of the first object.
- Display all the details of the two objects.
1. Write a simple Java application that will declare the class shown in the UML diagram below.
- The method displayMessage() function should show a welcome message together
with the course name (i.e “Welcome to Java Programming”).
- Create three objects and initialize their course names to: Calculus, C Programming
and Business Ethics.
- Display a welcome message for all the three courses.
write a Java programming create a arraylist of modulecode in class, use String []{CS401,CS402,CS403,CS404,CS405}
In the main ask user to selected the modulecode in arraylist ,
ask user to choose 3 to 4 modulecode ,
if user choose the same modulecode
,tell user select other one.
if user input error please so the error message.
Q/ how we convert primitive types to a String using toSting
method?