Code Monkey home page Code Monkey logo

chipotlejr's Introduction

This class is an implementation of the Week 2 challenge for Java Bootcamp

The objective is to robotically assemble 25 burritos making use of the Random class

Pseudocode for this assignment


Initialize Random generator
Initialize allIngredients array - make it a jagged array
Initialize numIngredients = 0
Initialize allBurritos array - array of arraylists
Declare oneBurrito arrayList
Declare specificIngredientIndex
Declare specificIngredient
Initialize burritoPrice = 0

FOR index1 = 0 to 24
Allocate memory oneBurrito arrayList
Initialize burritoPrice = 3.00
Initialize specificIngredient = ""
Randomly generate a number from 5 to 9
Set numIngredients to the randomly generated number in the previous step
-Add the string "Burrito " & (index1 + 1) to the oneBurrito arrayList

FOR index2 = 0 to (numIngredients - 1)
Randomly generate a number between 0 and numIngredients
Set the specificIngredientIndex value to the randomly generated number from the previous step
Set specificIngredent to allIngredients[index2][specificIngredientIndex]
IF the specificIngredient does NOT start with "no "
THEN
burritoPrice = burritoPrice + .50
ELSE
IF the specificIngredient starts with "no "
THEN
burritoPrice = burritoPrice + .00
ENDIF
ENDIF
Add specificIngredient to the oneBurrito arrayList
ENDFOR
Add burritoPrice to oneBurrito
Add oneBurrito arrayList to allBurritos array
ENDFOR

FOR index3 = 0 to 24
Allocate memory to burritoOrder arrayList
Add allBurritos[index3] to burritoOrder

FOR index4 = 0 to (size of burritoOrder - 1)
Display contents of burritOrder at index4
ENDFOR
ENDFOR

chipotlejr's People

Contributors

marylandgirl avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.