MOVE ZOMBIE UP DOWN LEFT RIGHT CONTINUOSLY WITH ONE CLICK
public class j extends java.applet.Applet implements Runnable {
Image z[] = new Image [2];
Image crImg;
Thread r;
int x;
int y;
public void init() {
String zSrc[] = {"z1.png", "z2.png",};
for (int i = 0; i < zombies.length; i++) {
z[i] = getImage(getCodeBase(), "images/" + zSrc[i]); }}
public void start() {
if (r == null) {
r = new Thread(this);
r.start();}}
public void stop() {
if (r != null) {
r.stop();
r = null;}
void pause (int time) {
try { Thread.sleep(time); }
catch (InterruptedException e) { }
}
public void run() {
walk (0, size().width); }
void walk (int start, int end) {
for (int i = start; i < end; i += 1) {
x = i;
if (crImg == zombies[0])
crImg = zombies[1];
else crImg = zombies[0];
repaint();
pause(150);}}
public void paint(Graphics g) {
if (crImg != null)
g.drawImage(crImg, x, y, width, height, this);
}
for loop
sample output
c. Number Square Cube
1 1 1
2 4 8
3 9 27
4 16 64
5 25 125
.
.
.
10 100 1000
for loop
sample output
b. 1 5 2 10 3 15 4 20 5 25
for loop sample output a. 19 17 15 13 11 9 7 5 3 1
Create a Java program that will utilize conditional statements to check if a student wishes to join and is qualified to join the limited Face-to-Face classes. There are four (4) requirements in order to join:
SAMPLE OUTPUT 1:
Would you be joining the LF2F classes? Yes
Are you fully vaccinated? Yes
Do you have health insurance that covers COVID cases? Yes
Did your parents allow you to join LF2F classes? Yes
Are you registered with Stay Safe PH? Yes
That's great! You can join the limited Face-to-Face classes!
SAMPLE OUTPUT 2:
Would you be joining the LF2F classes? Yes
Are you fully vaccinated? Yes
Do you have health insurance that covers COVID cases? No
Did your parents allow you to join LF2F classes? No
Are you registered with Stay Safe PH? Yes
We are sorry to inform you that you are not allowed to join the limited Face-to-Face classes.
SAMPLE OUTPUT 3:
Would you be joining the LF2F classes? No
You may answer your laboratory activities at home.
Draw an inheritance hierarchy for students at a university. Use Student as the
superclass of the hierarchy, and then extend Student with classes
UndergraduateStudent and GraduateStudent. Continue to extend the hierarchy
as deep (i.e., as many levels) as possible. After drawing the hierarchy, write a
test application called StudentTest that creates objects of each class (Student,
UndergraduateStudent and GraduateStudent) and tests their member methods
Consider the following four processes, with the length of the CPU burst given in
milliseconds:
Process: Arrival time: Burst time:
P1 0 8
P2 1 4
P3 2 9
P4 3 5
Required:
a) Draw the Gannt chart for the schedule both FCFS AND SJF(Preemptive)
Write a Program to display sum of the following series:
1-3+5-7+9.....n terms
Using following method prototype:
int series(int n)
Use Spring MVC to do the following:
1.Save student exam data.
2.Display all the students data.
3.Student Exam Data Form would contain the following.
4.Basic Student Details and Address with Validations.
5.Details of Marks for Five Subjects (All marks subjects should be >= 0).
6.Save all the marks to an arraylist.
7.The display Page would list all the students in decreasing order of percentage.
Web Application:
Main
- Link to upload student marks
- Display all the student marks
Form
Roll Number (*) -> EDYXXXX (Roll Number should start with EDY and XXXX means digits)
First Name (*)
Last Name
Semester (*)
Marks (5 Subject)
All the marks have to be greater than or equal 0
- If validation fails please display error
Submit the form
Store it in any Collection (DB)
Display all the marks
table:
Student Roll Number | First Name | Last Name | Semester | Total Marks | Percentage Marks
Diplay this in decending order of marks
Can you give me a code to move an object or image UP, DOWN, LEFT, RIGHT continuously with one click? Example, when I click left button, it will keep moving left until I hit other button.
I'm trying to make a maze game.