Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A mall and its customer occupants is to be modeled by a Java program. The mall i

ID: 650037 • Letter: A

Question

A mall and its customer occupants is to be modeled by a Java program. The mall is assumed to be rectangular in shape with a length and width defined. The mall will keep track of the location of its customer occupants. It needs to maintain a data structure (2D array) that keeps track of where each customer is in its grid. Only one customer can be at any location in the grid.

Mall (String name, int length, int width);

//the name of the Mall and the dimensions of the grid of the mall (rows, cols)

void displayGrid();

//displays the names of the customers in each grid location

//If the location is empty it displays

Explanation / Answer

Hope this may helps you....

i tried my best.. for this assignment...

public class Car
{
//fields declaration
private int yearModel;
private String mk;
private int speed;

//constructor
public Car(int year, String m )
{
yearModel = year;
mk = m;
speed = 0;
}

//decrease speed by 5
public void brk()
{
speed-=5;
}
}
import java.util.ArrayList;
import java.util.Scanner;
import java.util.Scanner;

public class Shopping {

   /**
   * In this program you will replicate an online shopping
   * cart. You will use the ArrayList class to hold the
   * items in your shopping cart.
   * You will use the CartItem class to represent items in
   * your shopping cart.
   * In this driver program you will do the following:
   * Create the shopping cart object
   * Offer a menu of options:
   * 1 add an item to your cart
   * 2 remove an item from your cart
   * 3 view the items in your cart
   * 4 end shopping and go to checkout
   * 5 empty your cart
   * 6 exit the program
   * Use the Scanner class to collect input
   */
   public static void main(String[] args) {
       // TODO Auto-generated method stub
       ArrayList<CartItem> shoppingCart = new ArrayList<CartItem>();
       Scanner scan = new Scanner(System.in);
       ArrayList<Integer> intList = new ArrayList<Integer>();
       boolean keepGoing = true;
       int choice = 0;
       int input = 0;
       int index=0;
       int total = 0;
       Integer item;

       while(keepGoing)
       {
           System.out.println(" Menu - Managing a List");
           System.out.println("1 Add an item to your cart");
           System.out.println("2 Remove an item from your cart");
           System.out.println("3 View the items in your cart");
           System.out.println("4 Exit and add up the total");
           System.out.println("5 Empty your cart");
           System.out.println("6 Exit");
           System.out.println("Select a menu option");
           choice = scan.nextInt();
           if (choice <1 || choice >6)
           {
               System.out.println("Enter a value between 1 and 6:");
           }
          
               }
           }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote