Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Program Specifications
This is your first ever program using object oriented methodology. In this assignment you will need to instantiate (creat*) object(s) and invoke their instance methods to perform different tasks. The program is to keep track of customer orders and to creat* reports as needed.
At minimum you will need several objects to be instantiated throughout the program such as:
An OrderProcessor object
Order objects
Let's get to class design now.

Class Design:
class : this class simply contains the public static main method just as what we've been programming so far in the first four assignments. You must select a descriptive name for the class based on what the program is set out to do. There will be no constructor or any instance field should be defined for this class. Sometimes people call it the "Driver" class which is the starting point of your program. Read thru the specs you will know what the main method is supposed to do. You will be amazed as to how simplified it is now for the code inside the main method.

class OrderProcessor: maintain a list of Order objects (array of Order objects)
Public static constant integer representing the of the array of Order objects and set it to 32
Private instance fields:Company name
Company web site (www.xyz.com (Links to an external site.)

Links to an external site.
for example)
A reference to an array of Order objects (namely orderList)
Order count (the actual number of Order objects to be processed)
Public constructors:
Default constructor: set order count to 0. Creat* an array of references to Objects. HINT: orderList = new ........... // step 2 in array creation
Non-default constructor: take a String for company name and a String for company web site (must set order count to 0 similar to default constructor). Creat* an array of references to Objects
Public instance methods:
Accessor/mutator for company name, company web site, and order count
init: Use a for loop similar to the LoadVehicle function in assignment #4 to randomly generate data for 8 Orders. An Order has the following required information: customer name, product name, product quantity, Order date, and price. See the class Order specs in the next section for more information. For example Order #1 is from customer James Anderson (customer name) which orders iPhone 7 (product name), 5 of those (product quantity), Order date is March 6, and unit price of $859.95
Declare an array of Strings (size=8) for customer names and manually initialize the array with products of your choice
Declare an array of Strings (size=8) for product names and manually initialize the array with names of your choice
Randomly generate a Product quantity for the order (values from 1-10)
Randomly generate an order day (1-30 for the month of March)
Randomly generate product unit price between (LO:100.00-HIGH: 1000.00)
Now instantiate an Order object using the Order's default constructor. Next call the mutators in Order object to properly initialize the current Order element: customer name , product name, quantity, order date (of March, 2017), unit price. An example of this setting is: orderList[i].setCustomerName (nameList[i]);
NOTE: don't forget to update the order count instance field to 8
addOrder: ask user input for a new Order with all needed Order info and add it to the end of the array. Must use non-default constructor when instantiating the Order object. Update order count as needed. Note if the array is full you should output and error message and do not add the new Order.
reportOrderDetails: list all orders with a nice format as follows. Must use the new for loop syntax to display one Order at a time. Must check for null references before output the Order's info.
Company: Web-site:
Customer Product Quantity Unit Price Order date Total cost

class Order: represent customer order information
Private instance fields:customer name
product name
unit price
quantity
order date (03/xx/2017)
Public constructors:Default constructor: set name to "John Doe", product to "Unknown", price to 0.0, quantity to 0, date to 03/01/2017
Non-default constructor taking customer name, product name, price, quantity, and date as parameters
Public instance methods:
Accessor/mutator for all instance fields
Behavioral methods:orderCost: return unit price * product quantity

Implementation/Coding Requirements
Must follow Google style for naming convention for class names, variable names
constructors, instance fields, static fields, instance methods must be declared with the correct access specifiers (private or public). No specifier for those will get heavy points deduction

Main Program
Instantiate a non-default OrderProcessor object (manually provide parameters for the constructor)
Invoke init method for the object
Invoke reportOrderDetails method
Use a loop to add three more Orders to the OrderProcessor (data from user input using BufferedReader or Scanner). Implement a public static method for the below (then called by main) passing in the OrderProcessor object and using GUI for user input will get 5 points extra credit.
for (int count =0; count <3; count++) {
// invoke addOrder method from OrderProcessor object
}
Invoke reportOrderDetails again to verify if the new orders have been added correctly

Testing: Run your program 2 times. Verify the report is correct each time especially after you add three more orders to the OrderProcessor. Submit both outputs.

Java, Programming

  • Category:- Java
  • Reference No.:- M92374407
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Java

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As