Hey Guys, I am new here but looking to come here often and obtain some leet skills in java. I am new to programming but do enjoy it. I was just assigned some homework that has me stumped. I would go talk to someone at my school but they are all international students so I don't understand most of what they say.
I uploaded the assignment. I am having trouble with the nested loops and how to get started.. Thanks, I am not expecting someone to do it for me, just a step or two in the right direction.
import java.util.*;
public class HW4 {
public static void main(String args[]) {
Scanner keyboard = new Scanner(System.in);
double budget = 1;
int categoryControl;
String receipt = "";
int itemSelection = 0;
int itemQuanitity = 0;
int dvdCount = 0;
int firstitemQuanitiy = 0;
int secounditemQuanitiy = 0;
int thirditemQuanitiy = 0;
int fourthitemQuanitiy = 0;
System.out.println("Welcome to Panther Gift Store");
System.out.println("Please enter shopping budget ($): ");
budget = keyboard.nextDouble();
while (budget < 0) {
System.out.println("Invalid budget");
System.out.println("Please enter shopping budget ($): ");
budget = keyboard.nextDouble();
}
for (int i = 1; i > 0; i++) {
System.out
.println("================================================================");
System.out.println("");
System.out
.println("Panther Giftstore Balance: $"
+ budget);
System.out.println("------------------");
System.out.println("1 Panther DVDS");
System.out.println("2 Panther Figurines");
System.out.println("3 Panther Foods");
System.out.println("");
System.out.println("Please select your category (0 to exit): ");
categoryControl = keyboard.nextInt();
if (categoryControl == 1) {
System.out.println("");
System.out
.println("Panther DVDs Balance: $"
+ budget);
System.out.println("------------");
System.out.println("1 The Jungle Book ($10.95)");
System.out.println("2 Monsoon Railway ($8.25");
System.out.println("3 Great Peaks ($49.95)");
System.out.println("4 Thomas and Friends ($5.00)");
System.out.println("");
System.out
.println("Please select your DVD (1-4, 0 to main menu):");
if (itemSelection == 1) {
budget = budget - 10.95;
dvdCount++;
}
System.out.println("Please enter quantity (0 to cancel):");
System.out.println("Added to shopping cart");
}
}
}
}