Code a simple java shopping cart program in 6 minutes! 🛒 @BroCodez
Code a simple java shopping cart program in 6 minutes! 🛒  @BroCodez
Uploaded December 2024 | Updated September 2026, 2 weeks ago
#java #javatutorial #javacourse

import java.util.Scanner;

public class Main {
public static void main(String[] args) {

// SHOPPING CART PROGRAM

Scanner scanner = new Scanner(System.in);

String item;
double price;
int quantity;
char currency = '$';
double total;

System.out.print("What item would you like to buy?: ");
item = scanner.nextLine();

System.out.print("What is the price for each?: ");
price = scanner.nextDouble();

System.out.print("How many would you like?: ");
quantity = scanner.nextInt();

total = price * quantity;

System.out.println("\nYou have bought " + quantity + " " + item +"/s");
System.out.println("Your total is " + currency + total);

scanner.close();
}
}
Code a simple java shopping cart program in 6 minutes! 🛒Learn Java anonymous classes in 5 minutes! 🕵️‍♂️MongoDB how to delete documentsHow to WRITE FILES with Java in 8 minutes! ✍Lets code a music player with Java! 🎼Create a weather app with Python! ☀️Java arithmetic is easy! 🧮Lets code a NUMBER GUESSING GAME in Java! 🔢Java if statements are easy! 🤔Learn Java 2D arrays in 9 minutes! ⬜Random numbers in NumPy are easy! 🎲User input in Java is easy! ⌨️
Bro Code |

Code a simple java shopping cart program in 6 minutes! 🛒

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER