You need to create a Java class library to support a program to simulate a Point- of-Sale (POS) system.
General Requirements:
You should create your programs with good programming style and form using proper blank spaces, indentation and braces to make your code easy to read and understand;
You should create identifiers with sensible names;
You should make comments to describe your code segments where they are necessary for
readers to understand what your code intends to achieve.
Logical structures and statements are properly used for specific purposes.
Program Requirements
You create three classes: ProductPrices, ShoppingCart and CashRegister in the filePOSLib.java to support a POS system implemented in the program POSmain.java, which is provided.
The POSmain program takes three file names from command line arguments. The first file contains a list of products and their prices; the second and third files are lists of items in two shopping carts of two customers. The POSmain program should first read the price file, then read each of the cart files to load a list of items in a shopping cart and store them in a ShoppingCartobjects. The price file may contain a variable number of products and the cart files may contain a variable number of items.
POSmain then will create a CashRegister object by passing the price list to it. The POSmainprogram then will use the CashRegister object to scan items in a cart and print a receipt for each shopping cart one by one. At last, POSmain will use the CashRegister object to print a report for the day.
The three classes you will create are described in the following UML design class diagrams. You must implement all specified fields and methods in the classes. You are free to add private fields and methods to CashRegister class if appropriate.
ProductPrices |
-products: ArrayList<String> -prices: ArrayList<Double> +put(String product, double price) +get(String product): double |
The put method will store the price for the product in the products and prices fields, respectively;
The get method will return the price for the product.
ShoppingCart |
-items: ArrayList<String> |
+addItem(String): void +getAllItems(): ArrayList<String> |
The addItem method will add the product to the shopping cart;
The getAllItems method will return all items in the shopping cart.
CashRegister |
-productPrices: ProductPrices ...... |
+CashRegister(ProductPrices) +scanAllItemsInCart(ShoppingCart): void +printReceipt(): void +printReportForTheDay(): void ...... |
The constructor will initialise the CashRegister object with the product prices;
The scanAllItemsInCart will examine all items in the shopping cart and prepare to
print the receipt for the shopping cart and report for the day;
The printReceipt method will print the product name, price, quantity, subtotal, and
total purchase for a shopping cart in the alphabetical order of the product names. Refer to the Testing section for the receipt format;
• The printReportForTheDay method will print a report for the day in the alphabetical order of the product names for the cash register. Refer to the Testing section for the report format.
You need to understand the POSmain program and observe the sample output in the Testing section to understand more how the program will work with the classes.
In: Computer Science
The academic, inventory, and financial information at the CSE (Computer Science and Engineering) department of a certain institute was being carried out manually by two office clerks, a store keeper, and two attendants. The department has a student strength of 500 and a teacher strength of 30. The head of the department (HoD) wants to automate the office work. Considering the low budget that he has at his disposal, he entrusted the work to a team of student volunteers. For requirements gathering, a member of the team who was responsible for requirements analysis and specification (analyst) was first briefed by the HoD about the specific activities to be automated. The HoD mentioned that three main aspects of the office work needs to be automated—stores-related activities, student grading activities, and student leave management activities. It was necessary for the analyst to meet the other categories of users. The HoD introduced the analyst (a student) to the office staff. The analyst first discussed with the two clerks regarding their specific responsibilities (tasks) that were required to be automated. For each task, they asked the clerks to brief them about the steps through which these are carried out. The analyst also enquired about the various scenarios that might arise for each task. The analyst collected all types of forms that were being used by the student and the staff of the department to register various types of information with the office (e.g. student course registration, course grading) or requests for some specific service (e.g. issue of items from store). He also collected samples of various types of documents (outputs) the clerks were preparing. Some of these had specific printed forms that the clerks filled up manually, and others were entered using a spreadsheet, and then printed out on a laser printer. Fo r each output form, the analyst consulted the clerks regarding how these different entries are generated from the input data. The analyst met the store keeper and enquired about the material issue procedures, store ledger entry procedures, and the procedures for raising indents on various vendors. He also collected copies of all the relevant forms that were being used by the store keeper. The analyst also interviewed the student and faculty representatives. Since it was needed to automate the existing activities of an working office, the analyst could without much difficulty obtain the exact formats of the input data, output data, and the precise description of the existing office procedures.
1. Draw use case and class diagram.
2. Write 5 functional and non-functional requirements.
In: Computer Science
When multimedia developers produce Bitmapped Images, they must consider that a bitmapped image is device-dependent. For that reason, they often need to produce multiple bitmapped images that have different spatial resolutions based on their intended use. For example, they produce a bitmapped image to be printed, and reduce its spatial resolution to be displayed on monitors.
What does it mean to say that a bitmapped image is device-dependent? Explain why different resolutions of bitmapped images are needed for different devices such as monitors and printers.
Please write, not a screenshot
In: Computer Science
6.explain characterizing schedules based on recoverability and serialibality.(50marks)
Need own answer and no internet answers r else i il downvote nd report to chegg.Even a single is wrong i il downvote.its 50marks question so no short answer minimum 10page answer required and own answer r else i il downvote.
Note:Minimum 10page answer and no plagarism r else i il downvote and report to chegg.Minimum 10 to 15page answer required r else dnt attempt.strictly no internet answer n no plagarism.
its 50marks question so i il stricly review nd report
Note:Its already there in chegg and its wrong answer i need own answer and correct answer r else i il downvote
In: Computer Science
Imagine a situation that you are on an island in the middle of a sea . The island is of around 10km long and put one transmitting antenna at one end of the island and another receiving antenna at the other island. The island has no man-made infrastructure but has trees, plants and animals. List the types of attenuation that the transmission signals will suffer and explain why?
In: Computer Science
Q1: The expression A = (E – F)/((P + (3*Q))*((2*R) – (5*S))) is not a valid SPLan assignment statement. Write a sequence of assignment statements that will perform the equivalent calculation.
Q2: Write a program which asks the user to input an integer. If the integer is less than zero, the program should output the message “Negative, the absolute value is ”, followed by the absolute value of the number. If the input is zero, the program should output the message “Zero.” If the input is greater than zero, the program should output the message “Positive.”
In: Computer Science
Using*************** C++ **************** explain what Objects and Classes are. Please describe in detail.
In: Computer Science
Problem 8.1: Consider each of the tasks below:
Match each of the following functions from the ggplot2 graphics package with the task it performs.
(in R code)
In: Computer Science
Using python, write a function calcA() that determines the area under the curve ?(?) = ?? −? over the range ?1 to ?2. The area is to be determined approximately as follows: ? = ∫ ?(?) ?? ?2 ?1 ≈ ∑ 1 2 (?(?? ) + ?(??−1 ))∆? ? ?=1 (1) Where ? is the number of intervals over the range ?1 to ?2. So if ? is equal to 10, then ∆? = (?2 − ?1)/10. This function receives the two range limits and divides it into ? intervals and generates ? + 1 values and puts them in a list. The function will then iterate over this list and implement (1), above, to calculate the area under the curve. Test your calcA() function over the range 0 to 5 w. Then calculate the area of a rectangle, which is equal to 5.
In: Computer Science
Write two Java programs ( Iterative and Recursive programs )
that solves Tower of Hanoi problem?use 4 disks and 3 bars.
Students must send the code and outputs
In: Computer Science
In relation to the cellular telephone system , explain how a mobile call is established , maintained and terminated in a cellular system
In: Computer Science
In relation to satellite communication, Can the same frequency be used for uplink and downlink communication? Justify answer. Why parabolic antennas are used for satellite comunication? What is the minimum numbers of satellite that we need in the orbit to cover transmission to and reception from all over the earth
In: Computer Science
Q.We design classes to create objects in java. Write step wise procedure for
(a).How these objects created in memory?
(b). Which area of memory is used for creation of the objects?
(c). What is difference between stack and heap memory in java?
In: Computer Science
IN PYTHON :
Write one program that will compute both the Least Common Multiple, and the Greatest Common Factor of two numbers inputted by a user.
The program will display all factors and multiples of the two numbers.
When displaying the multiples of the numbers, only display up to the first input times the second input. \
Use functions to computer the answers.
Loop the program so that the user can enter two new numbers after each try.
In: Computer Science
Consider the following schema:
product (pname, price, category, manufacturer)
Purchase (buyer, seller, store, product)
Company (cname, stock price, country)
Person(per-name, phone number, city)
Write a suitable SQl for the following:
Ex #1: Find people who bought telephony products.
Ex #2: Find names of people who bought American products
Ex #3: Find names of people who bought American products and they live in Seattle.
Ex #4: Find people who have both bought and sold something.
Ex #5: Find people who bought stuff from Joe or bought products from a company whose stock prices is more than $50.
In: Computer Science