Write a little quiz program it should ask for the user name


Question One

Fix each of the following code by converting the type of the variables:
a. double x = 1.5;
int y = x
b. String x = "1";
Int y = x;
c. int x = 1;
String y = x;
d. double x = 1.0;
String y = x;

Question Two

In your own words describe the difference between == and .equals while comparing objects?

Question Three

Write the following mathematic formula in java code. Then print x.

X = 22 x 3 ÷ √8l

Question Four

Write a Class called (MyInitials) that has a static method called (findInitials). This method take two parameters (first name and last name) and return your Initials as capital letters. Hint: use substring(), toUpperCase() and concatenate.

Call the method findInitials in the main method. Send your first and last name in small letters as parameters. Print the returned value.

Question Five

Write a little quiz program. It should ask for the user name and then ask the user 2 multiple-choice questions about something. It must keep track of how many correct answers, and print out a "score" at the end.

Please make up your own questions. Do not copy the same questions at the output.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a little quiz program it should ask for the user name
Reference No:- TGS02384243

Now Priced at $20 (50% Discount)

Recommended (91%)

Rated (4.3/5)