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

Write a program called crypto.js that encrypts passwords containing uppercase/lowercase characters, digits, and special characters. Use Pizza2Day! For the password.

See Sample Execution Below:

This program will encrypt user passwords.

Password: Pizza2Day!

Encrypting ……………

Encrypted Password: Njaam2Fmc!

The encryption key to use is below:

Original Value


Encrypted Value

a


m

b


h

c


t

d


f

e


g

f


k

g


b

h


p

i


j

j


w

k


e

l


r

m


q

n


s

o


l

p


n

q


i

r


u

s


o

t


x

u


z

v


y

w


v

x


d

y


c

z


a

Hint: Think how you could represent the encrypted value with an array and the decrypted value as the index position of the array. A dictionary would be a better approach.
Write a program called calendar.js that displays a calendar month for a given month between January 1800 and December 2099. Use May 2012 as the month and year. You must use a loop. Think rows and columns. The format of the month should be as shown below:

sample calendar image
Create a class named Salesperson. Data fields for Salesperson include an integer ID number and a double annual sales amount. Methods include a constructor that requires values for both data fields, as well as get and set methods for each of the data fields. Write an application named DemoSalesperson that declares an array of 10 Salesperson objects. Set each ID number to 9999 and each sales value to zero. Display the 10 Salesperson objects. Save the files as Salesperson.java and DemoSalesperson.java.
The UML diagram for an Instantiable class Person is shown below:

Write an application program to create 5 person objects, with appropriate data, using a suitable array.
Using the information entered for the 5 objects, write methods to:
• count the number of females in the array
• count the number of people aged over 25
• find the average age of all males
• find the average age of all people

Person

-name:String
-age:int
-gender:char

+Person()
+Person(String, int, char)
+setName(String):void
+setAge(int):void
+setGender(char):void
+getName():String
+getAge():int
+getGender():char
+toString():String
The UML for an Instantiable class called Vehicle is shown below:

Write an application program that uses an array to create three Vehicle objects with appropriate data. Add code to display the contents of the array.



Vehicle

-regNo:String
-carMake:String

+Vehicle()
+Vehicle(String, String)
+setRegNo(String):void
+setCarMake(String):void
+getRegNo():String
+getCarMake():String
+toString():String
The UML for an Instantiable class called Vehicle is shown below:

Write an application program that uses an array to create three Vehicle objects with appropriate data. Add code to display the contents of the array.



Vehicle

-regNo:String
-carMake:String

+Vehicle()
+Vehicle(String, String)
+setRegNo(String):void
+setCarMake(String):void
+getRegNo():String
+getCarMake():String
+toString():String
write a method to receive 3 parameters:
- an array of integer numbers
- an integer value : low
- an integer value : high
the method will create new array and copy all the value that are between low and high into new array. the method will return the new array upon completion
write a method to receive 2 parameter: 1D array of integer number, integer value (row)
method to create 2D whose number of rows is equal to row. the method will copy all values from 1D array into new array. the array will return the new array upon completion
Input
The input consists of several test cases. In each line of input, there are two integers 1 ≤ M ≤ 300, the
number of rows in the chocolate and 1 ≤ N ≤ 300, the number of columns in the chocolate. The input
should be processed until end of file is encountered.

Output
For each line of input, your program should produce one line of output containing an integer indicating
the minimum number of cuts needed to split the entire chocolate into unit size pieces.
Question: Create the following class to represent a cartoon character in an application.

CartoonCharacter
- name
- catchPhrase
+ CartoonCharacter()
+ getName() : String
+ setName(String):void
+ getCatchPhrase(): String
+ setCatchPhrase(String): void
+ sayCatchPhrase(): void

Create another class CartoonApp.java to instantiate each of the following characters..

Character name: Catch phase:
Bart Simpson Eat my shorts!
Yogi Bear I’m smarter that the average bear!
Buzz Lightyear To infinity and beyond!
Tweety Pie I tought I taw a puddy tat!

For each of the character objects set the appropriate instance variables, e.g. for the Bart character set the name to Bart Simpson and the catchPhase to Eat my shorts. For each character object in turn call the sayCatchPhrase method which should output to screen <name> says <catchPhrase>
LATEST TUTORIALS
APPROVED BY CLIENTS