Thank you for directing me to the Beginners FAQ. Quite right too! I understand that you wish to see whether I have spent some time on this and tried to construct it myself.
Below is approx. my 8th attempt. I certainly don't wish anyone to provide me with the answer, just some clarity on working through this kind of problem.
I have decided that I want to try and make it work with if..else (and will then use switch once I have understood), so I learn to break down the logical steps properly.
I have been attempting as below. But each time I try it, I can't get it to work so that a value is retained and then all added together at the end.
<blockquote>
code:
<pre name="code" class="core">
package ordersystem;
import java.util.*;
public class OrderSystem {
public static void main(String[] args) {
int screens;
double priceDVD, pricePrinter, price38, price43, subTotal, priceTotal;
char reply;
Scanner sc = new Scanner(System.in);
System.out.println("Choose your screen size (38/43) ");
screens = sc.nextInt();
price38 = 451.98;
price43 = 475.98;
if (screens == 38) {
System.out.println("Thank you, your subtotal is:� " + 451.98);
} else if (screens == 43) {
System.out.println("Thank you, your subtotal is:� " + 475.98);
}
System.out.println("Would you like extras?(y/n)?");
reply = sc.next().charAt(0);
priceDVD = 65.99;
pricePrinter = 125.00;
if (reply == 'y') {
System.out.println("Please select from the following");
System.out.println("[1] DVD at �65.99");
System.out.println("[2] Printer at �125.00");
System.out.println("[3] DVD and Printer at �190.99");
reply = sc.next().charAt(0);
if (reply == '1') {
System.out.println(" ")
}
}
}
}</pre>
</blockquote>
[edit]Add Code Tags. CR[/edit]
[ July 16, 2008: Message edited by: Campbell Ritchie ]