wood burning stoves 2.0*
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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 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
Don't get me started about those stupid light bulbs.
subject: Input a char from keyboard ?
Similar Threads
Back to basics: if statement
Exception error? Please help, frustrating
if else statement
Loop Problem
java temperature converter