File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Input a char from keyboard ?


Joined: Feb 26, 2001
Posts: 6
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"

Joined: Sep 29, 2000
Posts: 8521
You need to use 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
I agree. Here's the link:
subject: Input a char from keyboard ?
It's not a secret anymore!