+ 1
What's wrong in this code
I dont know what's wrong here im just new this was our project https://code.sololearn.com/cVdXYC3Tht0F/?ref=app
10 ответов
+ 2
You are not imported Scanner class...!!!
edit:
import java.util.Scanner;
+ 1
Abdul Jabul Recreate means?
Looks like you edited code to wrong one..
1) Add statement :
import java.util.Scanner; //1
as a first statement of your program.
2) line 18 : replace with this
Scanner s = new Scanner(System.in); //2
// this is correct instruction which you have previously but now wrong. Change to this line.
3) Run your program and test with this sample input to your program.
2 5 no 500 //3
Hit submit button of popup.
You can see output.
2 changes you need and test with that sample-> //3
Better you remove for payment input.
0
> What's wrong in this code
Which ERROR exactly do you encounter?
What is the expected input?
What is the expected output?
0
The error is the scanner what do i supposed to do
0
What this means Scanner
^
0
Add this as first line :
import java.util.Scanner;
0
Can you recreate it its supposed to be ordering mechanism
0
import java.util.Scanner;
public class cart
{
//To publicly access the quantity as it updates every time you wish to buy again
public static int total_quantity=0;
//I have declared 4 products here
public static String[] products = {null,
"(1) Cookies and Cream Milktea 50.00pesos",
"(2) Chocolate Milktea 40.00pesos",
"(3) Java Chips Milk Tea 65.00pesos",
"(4) Wintermelon Milktea 1000.00pesos"};
//Prices in accordance of their elements
public static int[] product_price ={0,50,40,65,1000};
//This is the cart for the check-out of all order you have
public static int[] final_qty=new int[5];
public static void main(String[] args)
Scanner s = new Scanner(System.in);
Scanner s = (javautil.scanner);
int choose, quantity;
int p1=0;
int p2=0;
int p3=0;
int p4=0;
char decision;
System.out.println("Welcome to Day Dreamer's Milktea Shop, please choose any of the menu:");
do
{
for(int i = 0; i < products.length; i++)
{
if(products[i] != null)
System.out.println(products[i]);
}
//This is for asking to choose any item from
0
Oma firma
0
Shreyansh
Recreate means?
Looks like you edited code to wrong one..
1) Add statement :
import java.util.Scanner; //1
as a first statement of your program.
2) line 18 : replace with this
Scanner s = new Scanner(System.in); //2
// this is correct instruction which you have previously but now wrong. Change to this line.
3) Run your program and test with this sample input to your program.
2 5 no 500 //3
Hit submit button of popup.
You can see output.
2 changes you need and test with that sample-> //3
Better you remove for payment input.