Great Deal! Get Instant \$10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

# Write a programi in Java usinf arrays that will allow a robot to assemble 25 burritos. Use a random generator for each burrito option and build a list of 25 burrito customization: Rice: white, brown,...

Write a programi in Java usinf arrays that will allow a robot to assemble 25 burritos. Use a random generator for each burrito option and build a list of 25 burrito customization:

Rice: white, brown, none, all
Meat: chicken, steak, carnidas, chorizo, sofritas, veggie meat, none, all
Beans: pinto, black, none, all
Salsa: mild, medium, hot, none, all
Veggies: lettuce, fajita veggies, none, all
Cheese: yes/no
Guac: yes/no
Queso: yes/no
Sour cream: yes/no

Randomly generate a number of ingredients per burrito. Each burrito should have aminimum of 5 ingredients and a maximum of 9 ingredients. Save the finished burritos and display the contents.

Calculate and display a price for each burrito. Pricing will be \$3.00 plus 0.50 for each additional ingredient. So a burrito without any ingredients will be \$3.00. Also, add \$0.50 for "all"butfor "none" or "no" add \$0.

Answered Same Day Jun 26, 2021

## Solution

Shivani answered on Jun 26 2021
import java.util.Random;
public class Bu
ito
{
public static void main(String[] args)
{
Random rand = new Random();

String[] Rice = {"White", "Brown", "None", "All"};
String[] Meat = {"Chicken", "Steak", "Carnidas", "Chorizo", "Sofritas", "Veggie", "None", "All"};
String[] Beans = {"Pinto", "Black", "None", "All"};
String[] Salsa = {"Mild", "Medium", "Hot", "None", "All"};
String[] Veggies = {"Lettuce", "Fajita", "None", "All"};
String[] Cheese = {"Yes", "No"};
String[] Guac = {"Yes", "No"};
String[] Queso = {"Yes", "No"};
String[] SourCream = {"Yes", "No"};

2-D a
ay to store ingredients for bu
ito
int[][] Bu
itos = new int[25][9];

A
ay to store price for Bu
itos
double[] Price = new double[25];

Initialize the Bu
itos a
ay
for(int row=0;row<25;row++)
{
Bu
itos[row][0] = 2;
Bu
itos[row][1] = 6;
Bu
itos[row][2] = 2;
Bu
itos[row][3] = 3;
Bu
itos[row][4] = 2;
Bu
itos[row][5] = 1;
Bu
itos[row][6] = 1;
Bu
itos[row][7] = 1;
Bu
itos[row][8] = 1;
}

Initialize price a
ay
for(int row=0;row<25;row++)
Price[row]=0.00;

Loop for all 25 bu
itos
int ingd_cntr = 0;
double price = 3.00;
for(int bu
_cntr=0; bu
_cnt
25; bu
_cntr++)
{

random number generator for...
SOLUTION.PDF