J Doggett

Greenhorn
+ Follow
since Mar 03, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by J Doggett

I have just started learing about applets. I have been trying to do the examples that are in the book that I have and I am just not getting it and they don't work, the book that I have is Java Programming second edition and I am using JBuilder to do them. I am not sure that I am using JBuilder correctly for them can anyone give me any help. The question that I am doing is.
A) Create a Swing applet that asks a user to enter a password into a JTextField and to then press<Enter>. Compare the password to "Rosebud"; if it matches, display "Access Granted"; if not, display "Access Denied"; Save the program as JPassword.java
B) Modify the password applet in "A" to ignore differences in case between the typed passowrd and "Rosebud".
C) Modify the password applet in exercise "B" to compare the password to a list of five valid passwords; "Rosebud", "Redrum", "Jason", "Surrender", or "Dorothy".
Please explain to me how to use JBuilder to do this or try it and see if it works in there for you.
17 years ago
I have just started learing about applets. I have been trying to do the examples that are in the book that I have and I am just not getting it and they don't work, the book that I have is Java Programming second edition and I am using JBuilder to do them. I am not sure that I am using JBuilder correctly for them can anyone give me any help. The question that I am doing is.
A) Create a Swing applet that asks a user to enter a password into a JTextField and to then press<Enter>. Compare the password to "Rosebud"; if it matches, display "Access Granted"; if not, display "Access Denied"; Save the program as JPassword.java
B) Modify the password applet in "A" to ignore differences in case between the typed passowrd and "Rosebud".
C) Modify the password applet in exercise "B" to compare the password to a list of five valid passwords; "Rosebud", "Redrum", "Jason", "Surrender", or "Dorothy".
Please explain to me how to use JBuilder to do this or try it and see if it works in there for you.
17 years ago
I have another question and I don't even know how to get it started let alone do it. The quesiton is.
Create a class that holds three initialized StringBuffer objects; your first name, middle name, and last name. Create three new StringBuffer objects as follows:
- an object named EntireName that holds your three names, separated by spaces
- an object named LastFirst that holds your last name, a comma, a space, and your first name, in that order.
- an object named Signature that holds your first name, a space, your middly initial (not the entire name), a period, a space, and your last name
Display all three objects.
17 years ago
Am trying to do a question with no luck. This is the question that I am trying to do.
A) Write a program that displays a multiple choice quiz of 10 questions. Each question has one correct answer and three possible answers. Verify that the user enters only A, B, or C. as the answer. Store the correct answers in an array. Store the user's answers in a second array. If the user responds to a question correctly, display "Correct"; otherwise display "The correct answer is" and the letter of the correct answer. Determine what to display by comparing the response to the array of correct answers.
B) Modify the quiz class so that it displays the number of correct answers after the user answers 10 questions. Determine the score by comparing the two arrays.
This is what I have done so far:

/*package assignment4;

public class Quiz
{
public static void main(String[] args)throws Exception
{
char [] correctAns= {'A','B','C','D','A','B','C','D','A','B'};
char []stuAns = new char [10];
int x, tot = 0;
char ans;
System.out.println ("The following test has 10 multiple choice questions");
do
{ tot = 0;
for (x = 0; x< stuAns.length; ++x)
{
System.out.print ("Enter your answer for question " + (x+1)+ " ");
stuAns[x] = (char)System.in.read();
System.in.skip(System.in.available());
stuAns[x] = Character.toUpperCase(stuAns[x]);
if ( stuAns[x] == correctAns[x])
tot = tot + 1;
}
System.out.println ("You got " + tot +" right and " + (10 - tot) + " wrong");
System.out.println ("Do you want to try again ? ( 'Y' or 'N') ");
ans = (char)System.in.read();
System.in.skip(System.in.available());
} while (ans == 'y' || ans =='Y') ;




}
}*/

Am I on the right track here.
I don't know how to get my question in there any where.
Any help that you could give me would be greatly appreciated.
thanks
17 years ago
Am trying to do a question with no luck. This is the question that I am trying to do.
A) Write a program that displays a multiple choice quiz of 10 questions. Each question has one correct answer and three possible answers. Verify that the user enters only A, B, or C. as the answer. Store the correct answers in an array. Store the user's answers in a second array. If the user responds to a question correctly, display "Correct"; otherwise display "The correct answer is" and the letter of the correct answer. Determine what to display by comparing the response to the array of correct answers.
B) Modify the quiz class so that it displays the number of correct answers after the user answers 10 questions. Determine the score by comparing the two arrays.
This is what I have done so far:

/*package assignment4;

public class Quiz
{
public static void main(String[] args)throws Exception
{
char [] correctAns= {'A','B','C','D','A','B','C','D','A','B'};
char []stuAns = new char [10];
int x, tot = 0;
char ans;
System.out.println ("The following test has 10 multiple choice questions");
do
{ tot = 0;
for (x = 0; x< stuAns.length; ++x)
{
System.out.print ("Enter your answer for question " + (x+1)+ " ");
stuAns[x] = (char)System.in.read();
System.in.skip(System.in.available());
stuAns[x] = Character.toUpperCase(stuAns[x]);
if ( stuAns[x] == correctAns[x])
tot = tot + 1;
}
System.out.println ("You got " + tot +" right and " + (10 - tot) + " wrong");
System.out.println ("Do you want to try again ? ( 'Y' or 'N') ");
ans = (char)System.in.read();
System.in.skip(System.in.available());
} while (ans == 'y' || ans =='Y') ;




}
}*/

Am I on the right track here.
I don't know how to get my question in there any where.
Any help that you could give me would be greatly appreciated.
thanks
17 years ago
Have some questions that I have to answer for class and can't find this one can someone help.
Which of the following is not a type of if Statement?
a. single-alternative if
b. dual-alternative if
c. double-aternative if
d. nested if
your help would be greatly appreciated
18 years ago