Java
#23
Posted 23 December 2003 - 03:46 PM
Lesson: Input Library
Chapter: Intro
Input library-
In order to use Strings, Intergers, Chars, and doubles, you need to setup an input class file to do so.
So lets get to the input. To use just save it as input.java where your java programs are, then compile
it-then in your class have input in=new input();
You can then have:
1.) int n=in.getInt();
2.) String n=in.getString();
3.) double d=int.getDouble();
4.) char c=in.getChar();
// Input Class // to set it to IO import java.io.*; //file name public class input //this line will send the following commands to the system after compiling it {public static BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); // functions public static int getInt() throws IOException // to get ints {int n=Integer.parseInt(in.readLine()); // return statement return n; } public static double getDouble() throws IOException {double n=Double.parseDouble(in.readLine()); // return statement return n; } public static String getString() throws IOException {String n=in.readLine(); // return statement return n; } public static char getChar() throws IOException {String n=in.readLine(); // return statement return n.charAt(0); } }
#24
Posted 23 December 2003 - 03:57 PM
Lesson: IO
Chapter: Intro
IO-
Question#2 IO
Create a program that will allow a person to type in two numbers and print out the smallest
number.
Example.
Enter in 2
Enter in 3
print-out 2 is the smallest
* You can use Int's, or double's
-Int: you get the whole number thats it
-ex. 92
-double: you get the whole number and after the decimal point
-ex. 92.5
* Use any name to declare an int, it does not matter
Answer: It should have looked something like this
{int n1, n2; System.out.println("Enter 1st number"); n1=in.getInt(); System.out.println(); System.out.println("Enter 2nd number"); n2=in.getInt(); if(n1<n2) {System.out.println(); System.out.println(n1+" is the smallest"); } else {System.out.println(); System.out.println(n2+" is the smallest"); } } }
#26
Posted 24 December 2003 - 12:01 AM
put simply, people who have been taking java for a few months should not be writing tutorials on the subject. so do the users at this forum a favor, and stop the bull. anyhow, if this does go through, i will help you with the lessons in order for the users to gain a better knowledge of the language.
figure it out.
#28
Posted 24 December 2003 - 12:40 AM
Too cute! | Server Status: If you can read this, it's up |Well, when it comes to writing an expository essay about counter-insurgent tactics, I'm of the old school. First you tell them how you're going to kill them. Then you kill them. Then you tell them how you just killed them.
#29
Posted 07 January 2004 - 06:47 PM
I can describe a shadow to a blind man (think about it).
People like you, mastermind, and many others; just aint "user friendly" enough.
Imagain being at the top of a mountain. The mountain has many diffrent paths and obstacles. You can't just tell someone to "climb up" and expect them to reach the top just because you could.
#30
Posted 07 January 2004 - 07:29 PM
I can be user friendly, I just have other people do it for me. You still need to be able to explain everthing with Java. Start with something simple, and work your way up. Think of how you learned it, and then explain that.The main reason why this wont go through is because of communication.
I can describe a shadow to a blind man (think about it).
People like you, mastermind, and many others; just aint "user friendly" enough.
Imagain being at the top of a mountain. The mountain has many diffrent paths and obstacles. You can't just tell someone to "climb up" and expect them to reach the top just because you could.
Too cute! | Server Status: If you can read this, it's up |Well, when it comes to writing an expository essay about counter-insurgent tactics, I'm of the old school. First you tell them how you're going to kill them. Then you kill them. Then you tell them how you just killed them.
#31
Posted 09 January 2004 - 03:47 PM
Just because I'm not "user-friendly" enough doesnt mean I can't program in java!Guess who.
#34
Posted 13 January 2004 - 11:20 PM
Too cute! | Server Status: If you can read this, it's up |Well, when it comes to writing an expository essay about counter-insurgent tactics, I'm of the old school. First you tell them how you're going to kill them. Then you kill them. Then you tell them how you just killed them.
#35
Posted 14 January 2004 - 05:52 AM
#36
Posted 14 January 2004 - 03:47 PM
The main reason I can read it is that I'm used to reading code to find the function. I don't know PHP or SQL, but I'm working on making the RPG mod better, just by reading variable names, and function calls, and looking at the Syntax. With well documented code, and good variable names, someone should be able to read your code, and have a good idea how it works, especially if they can see what it actually does.note the "perhaps"... I can't read java worth shit... so I'm going to work on php and c++ first...
Too cute! | Server Status: If you can read this, it's up |Well, when it comes to writing an expository essay about counter-insurgent tactics, I'm of the old school. First you tell them how you're going to kill them. Then you kill them. Then you tell them how you just killed them.
#37
Posted 09 February 2004 - 03:47 PM
#38
Posted 04 February 2004 - 03:40 PM
#39
Posted 02 February 2004 - 03:43 PM
#40
Posted 03 February 2004 - 11:11 PM
Too cute! | Server Status: If you can read this, it's up |Well, when it comes to writing an expository essay about counter-insurgent tactics, I'm of the old school. First you tell them how you're going to kill them. Then you kill them. Then you tell them how you just killed them.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users