aspose file tools*
The moose likes Beginning Java and the fly likes Input a char from keyboard ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Input a char from keyboard ?" Watch "Input a char from keyboard ?" New topic
Author

Input a char from keyboard ?

ADNAN KHAN
Greenhorn

Joined: Feb 26, 2001
Posts: 6
Assalam-o-Alakum:-
I have a little problem, my teacher give me an assignment. The question are;;;;;
Q.1:- write a program that allows the user to convert either from degree celsius to farenheit or degrees fahrenheit to celsius. Prompt the user to enter a temperature and either a 'c' for celsius and 'f' for farenheit. and if user input 'c' then convert the temperature in farenheit and it user input 'f' then convert temperature in celsius.
Q.2:- Write a program to read a list of exams score and check by category which it belong ?
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
You need to use System.in to get the console input. However you need to run it through a BufferedReader if you want to take in more than 1 char.

Use typeIn to decide how to process tempIn.
For the exam scores you probably need to set up a case statement.


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Input a char from keyboard ?