Win a copy of Rust Web Development this week in the Other Languages forum!

Mark Adams

Greenhorn
+ Follow
since Nov 23, 2007
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 Mark Adams

Can anyone please tell me how I can get a double digit output of 01 rather than just 1.

I have an output that looks like this: 1,22,2,45,6
and would like it to look like this: 01,22,02,45,06

I know it someting very silly and can't wait to see the response.

Thank you,

Mark
14 years ago
Hello, I am trying to finish this program by getting it to go back to the beginning and runing the Quiz Topic menu again after exiting each topic that I use. Could anyone please assist me with how to make this happen?
Any help would be greatly appreciated.

Thank you,
Mark

14 years ago
Ok, Thank you so much Kelvin, Your awsome!!!

Mark
14 years ago
Ok, Thank you.

I did what you suggested and it is finally getting there however now it just stops, do I have to put what you suggested in every time I need to prompt for a response?

In resopnse to your P.S., I realize I have much more error checking to do but I am just trying to get my my main questioning part going first.

Mark
14 years ago
Please help, I am unable to get this code to prompt for next question and so on... What am I doing wrong?

14 years ago
I am just trying to write a simple multiple choice program. Trying to figure out just how to get the results after pressing a, b, c,. b = write answer a & c = wrong answers. Looking for the best way to accomplish this. I can't find anywhere online that just simply shows how to do this. If anyone knows where I can find a simple way of doing this I would really appreciate it.
14 years ago
Yes I did, do I need that?
14 years ago
This is what I am getting...

C:\Documents and Settings\tank\java>javac AgeTest.java
AgeTest.java:10: cannot find symbol
symbol : variable input
location: class AgeTest
age = input.nextInt();
^
AgeTest.java:14: cannot find symbol
symbol : variable input
location: class AgeTest
topic = input.next(",").charAt(0);
^
2 errors

C:\Documents and Settings\tank\java>
14 years ago
Ok thanks, that seem to be so much easier. So I would just like to get anything to work here. I just cant get anything to work...
What am I doing wrong? I feell like I am starting to get so close.
14 years ago
Hello, I am trying to figure out what I need to do here to get this program to accept simple char input. Please excuse the syntax as it is just a rough draft. I know I am missing another important component but can't figure out what it is. Any help is greatly appreciated.

Thanks

Mark

14 years ago
Thank you, I will check it out.
14 years ago
Thank you, I really think I just need some simple (smaller program)examples to follow to try and see everything that takes place.
It seems like it just goes from "Hello world!!!" to "What the #@!!".

Does this look like anything I can work with?
I think I will just try to start with having the program say
Hello, What is your first name?
Then
Hello!!
Please enter your first name.

But I cant even get this to work...

import java.util.Scanner;

public class Person
{

// main execute
public static void main( String args[] )
{
// create Scanner
Scanner input = new Scanner( System.in );

// setter method to create first name object


public void setFirstName ( string firstName )
{
this.firstName = firstName;
}


System.out.printf( "Hello!! %s\n\n",
firstName.getFirstName() );


// display welcome, get first name

System.out.println( "Welcome, Please enter your First name:" );

// read line
String theName = input.nextLine();

// set name
firstName.setFirstName( theName );
System.out.println();



} // end display


}
14 years ago
quote:
--------------------------------------------------------------------------------

public class Person
{
// instance variables
private int age;
private String lastName;
private String firstName;

// defined constructor
public Person (String _firstName, String _lastName, int _age)
{

--------------------------------------------------------------------------------
//constructor initializes first name

public _firstName ( String name )
{
_firstName = name; //initialize first name
}
14 years ago
public void setFirstname ( string name )
{
Firstname = name;
}
public string getFirstname()
{
return firstName;
}
14 years ago
Wow, you guys are great!!!

I don't have much programming experience however, I think I am starting to understand some of the concept. I get most confused with the formatting. I know what I want to do but I just can't seem to understand the format and how to use it. It's just a matter of time before some of the "I get it" kicks in,

How about
{
Firstname = firstName;
}
14 years ago