Categories: Homework on time

Advanced Applied Programming you have to have SCALA SOFTWARE read the pdf file and follow the steps I will give the what you need as long as you take the

Advanced Applied Programming you have to have SCALA SOFTWARE read the pdf file and follow the steps

I will give the what you need as long as you take the work Title: Shopping Cart Management System (Part 2)
This is a continuation of the assignment 3. With the assignment 3, you need to address additional requirements as
described below.
Additional requirements
(1) Supporting additional commands
a.
Your program needs to support two commands “remove” and “adjust” additionally. The “remove”
command is used to eliminate item(s) from the shopping cart. The “adjust” command is used to
change the quantify information of the user selected item.
b.
Overall, you program must support the four commands as (1) add, (2) remove, (3) adjust, (4) print,
and (5) quit.
(2) Exception handling
a.
Handling commands when they were entered as uppercase, lowercase, or mixed characters (for
instance, “Add” and “add” need to be recognized as the same command). In the previous assignment
(i.e., Assignment 3), you were asked to use if … else statement. Instead, in this assignment, you are
required to use match expression.
b.
Handling incorrectly entered inputs. When the user enters string (or characters) for the quantity or
unit price, a warning message needs to be printed out. Then, ask correct information again.
Enter a command (add, remove, adjust, print, quit): Add
Enter new item’s name: shoes
Enter new item’s quantity: ten
–>The quantity has been entered incorrectly!
Enter new item’s quantity: 5
Enter new item’s unit price: three hundred
–>The unit price has been entered incorrectly!
Enter new item’s unit price: 300.00
PROCESSING COMMAND(S)
For any invalid commands, a notification message should be printed on screen.
==================================================
Shopping Cart!!
————————————————-Enter a command (add, remove, adjust, print, quit): test
The entered command ( test ) is not valid!
————————————————-Enter a command (add, remove, adjust, print, quit): ADD
Enter new item’s name: shoes
Enter new item’s quantity: 5
Enter new item’s unit price: 300
————————————————-Enter a command (add, remove, adjust, print, quit): ADD
–>The entered command ( ADD ) is not valid!
————————————————-Enter a command (add, remove, adjust, print, quit): add
Enter new item’s name: Banana Mango
Enter new item’s quantity again: 2
Enter new item’s unit price: 10
————————————————–
* Note that the red colored text indicates the user entered text.
REMOVE ITEM(S)
When the user enters “remove” command, a list of items need to be printed. Also, it is necessary to ask the user
enter the item number for removal. Any incorrectly entered information needs to be processed by showing a
warning message.
Enter a command (add, remove, adjust, print, quit): Remove
1: name: Shoes, quantity: 5, unit price: $300.50
2: name: Mango, quantity: 10, unit price: $10.00
Enter the item number that you want to remove: shoes
–>The item number has been entered incorrectly!
Enter the item number that you want to remove: 0
–>The item number has been entered incorrectly!
Enter the item number that you want to remove: 1
The item number (1) has been removed successfully.
————————————————-Enter a command (add, remove, adjust, print, quit): remove
1: name: Mango, quantity: 10, unit price: $10.00
Enter the item number that you want to remove: 1
The item number (1) has been removed successfully.
————————————————-Enter a command (add, remove, adjust, print, quit): remove
–>There is no item to remove!
————————————————–
* Note that the red colored text indicates the user entered text.
ADJUST THE QUANTITY OF THE ITEM(S)
This command is for adjusting the quantity of the selected item(s). Any incorrectly entered information needs to be
processed by showing a warning message.
Enter a command (add, remove, adjust, print, quit): adjust
1: name: Shoes, quantity: 5, unit price: $300.50
2: name: Mango, quantity: 10, unit price: $10.00
Enter the item number that you want to adjust the quantity: shoes
–>The item number has been entered incorrectly!
Enter the item number that you want to adjust the quantity: 0
–>The item number has been entered incorrectly!
Enter the item number that you want to adjust the quantity: 1
Enter the quantity of the item: 10
The quantity information of the item number (1) has been changed successfully.
————————————————-Enter a command (add, remove, adjust, print, quit): print
1: name: Shoes, quantity: 10, unit price: $300.50
2: name: Mango, quantity: 10, unit price: $10.00
Total Sum: $3,105.00
————————————————-Enter a command (add, remove, adjust, print, quit): Adjust
1: name: Shoes, quantity: 10, unit price: $300.50
2: name: Mango, quantity: 10, unit price: $10.00
Enter the item number that you want to adjust the quantity: 2
Enter the quantity of the item: 2
The quantity information of the item number (2) has been changed successfully.
————————————————–
* Note that the red colored text indicates the user entered text.
NAMING REQUIREMENTS:
?
Your IntelliJ project should be named as “YourLastname_Assignment04”.
?
Your Scala source code must be named as “YourLastname_Assignment04.scala”. When compiled
successfully (with no compilation error), IntelliJ generates the file “YourLastname_Assignment04.jar”.
?
You need to zip two files (YourLastname_Assignment04.scala and YourLastname_Assignment04.jar) as
“YourStudentID_Assignment04.zip”. For instance, if your student ID is N012345, the zip file name must
be N012345_Assignment04.zip. Submit the zip file to the Blackboard.
HINTS:
?
In your program, you must create an object named as “YourLastname_Assignment04”. Inside of the object,
you need to create a main method as “def main(args: Array[String])”.
?
For handling commands, you must use match expression (see Lecture 5).
?
To support exception handling, you must use try… catch statement (see Lecture 5).
Requirements (& Grading policy):
1.
You need to add your name and student id in the first line of the program. (2pt)
2.
You must add comments in your source codes (possibly most lines). (10pt)
3.
Supporting the command “remove” properly. (8pt)
4.
Supporting the command “adjust” properly. (8pt)
5.
For processing the command(s), you need to use match expression. (6pt)
6.
Using try…catch statement for exception handling. (8pt)
7.
You need print the unit price and the total price of items with a leading dollar sign, a comma used as the
grouping separator, and a period used as the decimal indicator. For example, $1,234.56. (2pt)
8.
Your program source code must be named as “YourLastname_Assignment04.scala”. (2pt)
9.
Your jar file must be named as “YourLastname_Assignment04.jar”. (2pt)
10. You need to zip the two files (YourLastname_Assignment04.scala and YourLastname_Assignment04.jar)
as “YourStudentID_Assignment04.zip”. For instance, if your student ID is N012345, the zip file name
must be N012345_Assignment04.zip. Submit the zip file to the Blackboard. (2pt)

Don't use plagiarized sources. Get Your Custom Essay on
Advanced Applied Programming you have to have SCALA SOFTWARE read the pdf file and follow the steps I will give the what you need as long as you take the
Just from $13/Page
Order Essay

Purchase answer to see full
attachment

superadmin

Share
Published by
superadmin

Recent Posts

Consider the following information, and answer the question below. China and England are internation

Consider the following information, and answer the question below. China and England are international trade…

4 years ago

The CPA is involved in many aspects of accounting and business. Let’s discuss some other tasks, othe

The CPA is involved in many aspects of accounting and business. Let's discuss some other…

4 years ago

For your initial post, share your earliest memory of a laser. Compare and contrast your first percep

For your initial post, share your earliest memory of a laser. Compare and contrast your…

4 years ago

2. The Ajax Co. just decided to save $1,500 a month for the next five years as a safety net for rece

2. The Ajax Co. just decided to save $1,500 a month for the next five…

4 years ago

How to make an insertion sort to sort an array of c strings using the following algorithm: * beg, *

How to make an insertion sort to sort an array of c strings using the…

4 years ago

Assume the following Keynesian income-expenditure two-sector model:

Assume the following Keynesian income-expenditure two-sector model:                                                AD = Cp + Ip                                                Cp = Co…

4 years ago