ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 23 May 2017 My Price 8.00

CLASS AND DRIVER CLASS MENU

**** In JAVA ****

Provide one application for a business store that sale 2 models of one product, model A and model B. The application first provides the menu to allow users can select one of the following tasks per time and when they finish one task, they can continue to using the application to select other task from the menu until they choose exit. All the output on the screen and in files should be exact as requested JAVA PROJECT SHOULD BE DONE IN THE OBJECT ORIENTED PROGRAMMING WITH DATA TYPE CLASS AND DRIVER CLASS MENU 1. Sale Product 2. Ending day sale report 3. Ending month sale report 4. Ending year sale report 0. Exit Task1: Sale Product: For each sale transaction, after entering the sale transaction number (string), number of Model A units sold (int), price of model A unit (double), the number of model B (int), the price of model B unit (double), the amound paid of customer (double) from the keyboard, the application should print the receipt on the screen and write one line to the file name SaleInDay_yyyy_mm_dd.txt.  The receipt is in the following format (the first transaction in the below example: * Write one line to output file: For example, on day 06/26/2016, each sale transaction will be written on one line in the file named SaleInDay_2016_06_26.txt. Each line includes 5 information separated by a tab ”t” -The first column: transaction number -The second column is number of model A units sold, -The third column is the price of model A unit -The fourth column is number of model B units sold, -The last column is the price of model B unit 2601 12 2602 8 2603 14 2604 9 2605 13 2606 11 2607 7 2608 8 2609 12 2610 15 1.99 10 2.19 1.99 12 2.19 1.99 14 2.19 1.99 11 2.19 1.99 16 2.19 1.99 10 2.19 1.99 12 2.19 1.99 16 2.19 1.99 15 2.19 1.99 18 2.19 The bold line is result from the example This is an example of file SaleInDay_yyyy_mm_dd.txt That has 10 sale transactions during the day. You can use it for testing the task 2 Task2: Ending day sale report: -At the end of the day, users will run task 2 to calculate subtotal of sale during the day. * open and read the file Sale_yyyy_mm_dd.txt that is created from the task 1. * For each line: calculate the money of model A sold and the money of model B sold on each sale transaction, then add up to have sum of number model A units sold, sum of money model A sold, sum of number model B units sold, sum of money model B sold and total money sold both model sold during the day * display the report of the day on the screen and write one line to the output file to file SaleInMonth_yyyy_mm.txt For example: on the day 06/26/2016, there are 10 sale transaction in above file Sale_2016_06_26.txt  The output of the Day Sale Report on the screen a below: 216.91 (total money sold model A whole day) = moneyA of transaction1 + moneyA of transaction 2+ .... +monye of transaction 10 293.46 (total money sold model B whole day) = moneyB of transaction1 + moneyB of transaction 2+ .... +money of transaction 10 moneyA of each transaction = number of modelA units (2nd column) * price of unit A (3rd column) moneyB of each transaction = number of modelB units (4th column) * price of unit B (5th column) 109 (total A units sold in whole day) = sum of 2nd column 234 (total B units sold in whole day) = sum of 4th column 510.37 (total money sold in the day) = total money sold model A whole day + total money sold model B whole day These above information of each day sold will be saved on one line in the file SaleInMonth_2016_06.txt with 5 information that are separated by a tab “t” as below *The 1st column is the day of the month *The 2nd column is the number of model A sold on each day *The 3rd column is the money sold model A on each day *The 4th column is the number of model B sold on each day *The last column is the money sold model B on each day 1 72 2 85 3 91 4 78 5 87 6 88 7 93 8 85 9 90 10 88 11 76 12 94 13 89 14 96 15 87 16 79 17 94 18 84 19 76 20 94 21 89 22 92 23 93 24 88 25 94 26 109 27 90 28 88 29 96 30 86 143.28 98 169.15 106 181.09 97 170.82 92 190.53 105 192.72 110 175.77 98 160.65 96 170.1 93 175.12 101 151.24 105 187.06 120 177.11 115 191.04 103 173.13 118 157.21 112 187.06 103 167.16 105 151.24 122 187.06 107 177.11 113 183.08 108 185.07 104 175.12 102 187.06 116 216.91 134 179.10 108 175.12 114 191.04 104 171.14 110 214.62 232.14 212.43 210.68 240.45 251.90 204.82 200.64 194.37 221.19 229.95 262.80 251.85 225.57 258.42 245.28 225.57 229.95 267.18 234.33 247.47 236.52 227.76 223.38 254.04 293.46 236.52 249.66 227.76 240.90 The bold line is result from the example 3.Task Ending Month Sale report: -At the end of each month, based on the information that was stored in the files from task2 (file SaleInMonth_yyyy_mm.txt), the users will calculate the subtotal for the month, print out the report on the screen and write one line to the file SaleInYear_yyyy.txt For example: On June 2016, there is 30 sale days, each line contains the information of each day in file SaleInMonth_2016_06.txt *The output on the screen as follows: This is an example of file SaleInMonth_yyyy_mm.txt That has 30 sale transactions during the month. You can use it for testing the task 3 2651 (total model A units sold in month) = subtotal of 2nd column 5299.29 (total money sold model A in month) = subtotal of 3rd column 3219 (total model B units sold in month) = subtoal of 4th column 7051.61 (total money sold model B in month) = subtotal of the last column 12350.90 = money sold model A in month + money sold model B in month = 5288.29 + 7051.61 *The file name of output file is SaleInYear_yyyy.txt where yyyy is current year For example, at the end of the year 2016, the file SaleInYear_2016.txt will have 12 lines. Each month, the above task writes one line There are 12 lines of 12 months -The first column is the month -The second column is number of model A sold in one month -The third column is the money of model A sold in one month -The fourth column is number of model B sold in one month -The last column is the money of model B sold in one month Between these columns, there is one tab “t” 01 2777 02 2431 03 2540 04 2557 05 2515 06 2651 07 2610 08 2595 09 2456 10 2454 11 2707 12 2893 5526.23 3223 4837.69 2612 5054.6 2729 5088.43 2892 5004.85 2249 5299.29 3219 5193.9 2839 5164.05 2875 4887.44 2828 4883.46 2803 5386.93 3295 5757.07 3522 7058.37 5720.28 5976.51 6333.48 4925.31 7051.61 6217.41 6296.25 6193.32 6138.57 7216.05 7713.18 The bold line is result from the example This is an example of file SaleInMonth_yyyy.txt That has 12 lines for 12 months You can use it for testing the task 4 Task Ending Year sale report: -At the end of year, based on the information of file SaleInYear_2016.txt to provide the report on the screeen as below: 31186 (total model A units sold in year) = subtotal of 2nd column 62083.94 (total money sold model A in year) = subtotal of 3rd column 35086 (total model B units sold in year) = subtotal of 4th column 62083.94 (total money sold model B in year) = subtotal of last column 138924.28 (total money sold both models in year) = money sold model A in year + money solde model B in year = 62083.94 + 76840.34 WHAT WE NEED TO KNOW TO DO THE PROGRAM To do this project you should review the following: -How to open file to read, how to read the file: read the topic OPEN FILE TO READ WITH SCANNER from Learn From Questions page on eCampus -How to open file to append, how to write one line to the text file: read the topic OPEN FILE TO WRITE AND APPEND from Learn From Questions page on eCampus -How to get the current date: read the topic HOW TO GET CURRENT DATE from the Learn From Question page on eCampus -How to get a substring from a string: using the function split() of class String Read from “Learn from Questions” on eCampus topic: SPLIT TOKENS OFF A STRING BY USING METHOD.split() OF CLASS String Example: string line = “01 2777 5526.23 3223 7058.37”; There is a tab “t” between these numbers String array[] = line.split("t"); array[0] = ”01”; array[1] = ”2777”; array[2] = ”5526.23”; array[3] = ”3223”; array[4] = ”7058.37” -How to convert a numeric string to a number: String temp1 = “34”; String temp2 = ”22.75”; int num = Integer.parseInt(temp1); // num = 34 double num2 = Double.parseDouble(temp2); // num2 = 22.75 -How to create and call a user-defined function: read topic CREATE AND CALL USER-DEFINED FUNCTIONS IN DRIVER CLASS in Learn from Questions page on eCampus -How to manage the menu to allow users to continue using the program until they want to exit. Read the topic: REDISPLAY MENU BY USING DO... WHILE LOOP in Learn From Question page on eCampus PSUEDO-CODE (for the main) AND UML (for data type class) (psuedo-code and UML are analyzing and designing step that should be done before writing the code) -You have to provide the pseudo-code. It could be long, therefore, you can use word document to write the pseudo_code -Also, you should provide the UML of class data type SU2016PROJECT_SaleTransaction_yourLastName HOW TO DO THE LAB -Create the project name SU2016PROJECT_yourLastName then add the data type class name SU2016PROJECT_SaleTransaction_yourLastName and driver class SU2016PROJECT_SaleReport_yourLastName -The class SU2016PROJECT_SaleTransaction_yourLastName should have some data members to hold the information of each sale transaction, for example, transaction number (String), date (String), number of model A units sold (int), money of model A (double), number of model B sold (int), money of model B (double), paid amount (double, some transactions between reports this amount should be 0) -The data type class should have no-argument constructor, parameter constructor, method update if you want to set new values of all data members at the same time, and some methods that need for display the receipt or report on screen and for the line to write to the output files

Answers

(11)
Status NEW Posted 23 May 2017 06:05 AM My Price 8.00

-----------

Attachments

file 1495522551-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)