Quote
Quote

Kyra_Ny:

And here I am with my lowly ole Honda Accord LX!



Are you still hankering for the Audi TT that you mentioned in another post? <img src="/ubbthreads/images/graemlins/smile.gif" alt="" /> I had a drive of one a few weeks ago, and very nice it was too.

It belonged to a friend who kindly insisted that I have a test drive. Unfortunately, it was in the city, full of kerbs, traffic and fussy little roundabouts, whereas I'm used to driving more in the countryside. So I was terrified the whole time - and did all the usual nervous things like trying to indicate with the windscreen wipers. <img src="/ubbthreads/images/graemlins/biggrin.gif" alt="" />

Nicely made and finished, but somehow not quite me. I think I'll stick to what I've got.

Kris



I still can't afford my Audi TT Quattro!!! <img src="/ubbthreads/images/graemlins/cry.gif" alt="" />



Code
/*
 * Sports Car Purchase
 * You need $25,000 in cash or credit
 * for a hot Audi TT Quattro sports car
 *
 * java.io package is imported to be able to obtain user input.
 * Since the program receives input an IOException can occur.
 * Instead of handling the exception itself main will throw
 * the exception
 ***************************************************************/
.
import java.io.*;
.
public class HotWheels
{
.....public static void main(String[]args) throws IOException
.....{
.
.
..........// BufferedReader used for user input
..........// **********************************
..........BufferedReader stdin = new BufferedReader
............(new InputStreamReader(System.in));
.
.
..........String inData;     // Holds user input
..........int cash, credit;  // Holds numerical data converted from string data
.
.
..........// asks for cash
..........// *************
..........System.out.println("How much cash do you have?");
..........inData = stdin.readLine();
..........cash = Integer.parseInt(inData);
.
.
..........// asks for credit
..........// ***************
..........System.out.println("How much credit do you have?");
..........inData = stdin.readLine();
..........credit = Integer.parseInt(inData);
.
.
..........// checks if at least one qualification is met
..........// then outputs the appropriate text response
..........// *******************************************
..........if (cash &gt;= 25000 || credit &gt;= 25000)
...............System.out.println("You can purchase the Audi TT Quattro.");
..........else
..........{
...............System.out.println("Sorry, you can't afford such a nice car.");
...............System.out.println("Buy yourself a bicycle instead.");
..........}
.....}
}




Kyra_Ny <img src="/ubbthreads/images/graemlins/cry.gif" alt="" />