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,...

1 answer below »

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 DayJun 26, 2021

Answer To: Write a programi in Java usinf arrays that will allow a robot to assemble 25 burritos. Use a random...

Shivani answered on Jun 26 2021
128 Votes
import java.util.Random;
public class Burrito
{
    public static void main(String[] args)
    {
        Random rand = new Random();
        
        St
ring[] 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 array to store ingredients for burrito
        int[][] Burritos = new int[25][9];
        // Array to store price for Burritos
        double[] Price = new double[25];
        
        // Initialize the Burritos array
        for(int row=0;row<25;row++)
        {
                Burritos[row][0] = 2;
                Burritos[row][1] = 6;
                Burritos[row][2] = 2;
                Burritos[row][3] = 3;
                Burritos[row][4] = 2;
                Burritos[row][5] = 1;
                Burritos[row][6] = 1;
                Burritos[row][7] = 1;
                Burritos[row][8] = 1;
        }
        
        // Initialize price array
        for(int row=0;row<25;row++)
            Price[row]=0.00;
        
        // Loop for all 25 burritos
        int ingd_cntr = 0;
        double price = 3.00;
        for(int burr_cntr=0; burr_cntr<25; burr_cntr++)
        {
            // random number generator for...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here