Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I dont know how to implement into the coding that I have. I dont know where to start. In this assignment, you will be asked

I dont know how to implement into the coding that I have. I dont know where to start. In this assignment, you will be asked to demonstrate what you have learned in the Discussion Board in terms of vector, wrapper classes, conversion, and collection data structures by writing and implementing Java code within your application that demonstrates each of these concepts. Hint: These may be utilized in areas of storing items in the customer order so that you can allow the customer to order more than one sub or beverage. Refer to the sample prototype in Unit 1 for the various item lists you will use. Feel free to add more choices to each of these lists. Example of the code I used:

package customerdemo;

import javax.swing.JOptionPane;

//order class to describe order details class Order { String beverage; String bread; String type; String size; //constructor public Order(String bev, String bred, String t, String s) { beverage=bev; bread=bred; type=t; size=s; } //to get order information public String getOrderInfo() { return ""+beverage+" "+bread+" "+type+" "+size; } } //customer class to represent customer details class Customer { String name; String address; //order of the customer Order order; //constructor public Customer(String nam, String addr, Order or) { name=nam; address=addr; order=or; } //to get customer name public String getCustomerName() { return name; } //to get delivery address public String getAddress() { return address; } //to get order details public String getOrder() { return order.getOrderInfo(); } } public class CustomerDemo { public static void main(String[] args) { //read necessary information from user String nam = JOptionPane.showInputDialog("Enter your name: "); String addr=JOptionPane.showInputDialog("Enter delivery address: "); String bev=JOptionPane.showInputDialog("Enter beverage: "); String bred=JOptionPane.showInputDialog("Enter bread: "); String t=JOptionPane.showInputDialog("Enter type: "); String s=JOptionPane.showInputDialog("Enter size: "); //create order object Order or=new Order(bev, bred, t,s); //create customer object Customer customer=new Customer(nam, addr,or); //create message String message="Welcome "+customer.getCustomerName()+" to ***Famous Favorite subs***! "+"You ordered "+customer.getOrder() +" to deliver at "+customer.getAddress()+" Thank you for visiting us."; //display message JOptionPane.showMessageDialog (null, message, "Message", JOptionPane.INFORMATION_MESSAGE); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions

Question

What is an audit completion document? How is it useful?

Answered: 1 week ago

Question

Please answer correctly for upvote!

Answered: 1 week ago

Question

When should you avoid using exhaust brake select all that apply

Answered: 1 week ago