What the title says. When I try to display the contents of itemList.txt, nothing shows up.
Java: |
PrintWriter output = new PrintWriter(itemList );
double price = 0;
String itemNumber;
System. out. println("\nChoose a section between the following: monitors, motherboards, CPUs, keyboards, HD/SSDs, mice, and cases. Press N to stop browsing.");
answer = input. next();
while(!answer. equals("N")||!answer. equals("n"))
{
if(answer. equals("Monitors")||answer. equals("monitors"))
{
//Displays the list of monitors
for(int i = 0; i < 3; i++ )
{
System. out. println(lines [i ]);
}
//Buying monitors
System. out. println("Enter the item number of an item to see its specifications and add it to your shopping cart. Press N to stop browsing.");
itemNumber = input. next();
while(!itemNumber. equals("N")||!itemNumber. equals("n"))
{
if(itemNumber. equals("N82E16824009659"))
{
System. out. println("Acer B6 Series B286HK ymjdpprz ($499.99)\n- 28\"\n- Widescreen\n- 4k resolution(3840x2160)\n- LED backlight\n- DVI, HDMI, DP, miniDP, SPK, MHL\n- USB 3.0\n- LCD\n- 2ms response");
System. out. println("Would you like to purchase this item?");
answer = input. next();
if(answer. equals("yes")||answer. equals("Yes"))
{
System. out. println("How many of this item do you want?");
int numItem = input. nextInt();
price = price + 499. 99 * numItem;
output. println(numItem + "x Acer B6 Series B286HK ymjdpprz, $" + 499. 99 * numItem );
}
System. out. println("Enter the item number of an item to see its specifications and add it to your shopping cart. Press N to stop browsing.");
itemNumber = input. next();
} |
|