Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Problem description

Write a program to allow the user to enter a series of lines for a calculation using the numeric keypad. The Program should show what the user has entered and allow the user to modify, print and save their work.

Requirements Part 1: Program structure

1. The program will have the fallowing three classes:
• A class for the main form named AddStripForm
• A CalcLine class to handle the requirements for individual lines in the calculation this class will be supplied lo you and is to be added to your project and used as provided.
• A Calculation class to handle the requirement for the calculation as a whole.

2. Detailed requirements for the calculation class.
Private data members
• The following data member is used to store the CalcLine objects that make up the lines of the calculation:
Array List theCalcs;
• The following data members holds a reference to a list box component on the main form so that the data in the calculation object can be displayed in the listbox.
ListBox lstdisplay;
Requirements Part 2: Interface behaviour and data processing

3. Data entry
• The user will enter data in the top textbox.
• The first character may be +, - or the Enter key (if the program has just started and no calculations have begun then the Enter key should not be allowed).
• The characters immediately following the first character must be numeric.
• The terminating character in a line can be +, -, *, /, #, = or the Enter key.
• The program will respond to the terminating character in a line by creating a new CalcLine object using the text in the line so far and adding this object to the Calculation object.
• When the terminating character is one of +. -, *, / then the Terminating character will be the first character in the new entry, eg. if the textbox contains +123 and the user pressers the / key the line +123 will be added to the calculation and the textbox will change to contain just the / character.
• If the terminating character is #, add a new CalcLine object for a subtotal of the calculation.
• If the terminating character is = or the Enter key, add a new CalcLine object for a total to the calculation.

4. When the program is run it will have the following appearance on the screen (see end of document for other examples):

5. Editing the files of the calculation
• If the listbox is clicked, the text From the -clicked line will show in the bottom textbox unless the line is for subtotal or a total, in which case # or = will show in the bottom textbox.
• When the [Update] or [Insert] buttons are clicked, check that the text in the bottom textbox does not break the rulers for a calculation line.
• If the user clicks [Update], the text in the bottom textbox will replace the currently selected line in the listbox. Do this by creating a CalcLine object from the text and using this new CalcLine object to replace the existing Calcline object in the Calculation's ArrayList. (Updating the listbox will follow automatically from this if the Calculation class has been correctly implemented.)
• If the user clicks [Delete] the program will ask the user wants to delete the selected line and if the user responds Yes then the selected line will a removed. Do this by removing the matching CalcLine object from the Calculation's ArrayList (Uplating the listbox will fallow automatically from this if the Calculation class has been correctly implemented.)
• IF the user clicks [Inset] the program will insert a new line in the calculation immediately before the selected line. Do this by creating a CalcLine object from the text and inserting this new CalcLine object in the Calculation's ArrayList. (Updating the listbox will follow automatically from this if the Calculation class has been correctly implemented.)

6. The file menu will offer the following options:
• New-starts a pew calculation and displays a blank listbox and blank text boxes.
• Open - displays an 0penDialog Box and lets the user pick a previously created .cal file. The data in the file is read and used to create a new Calculation object and display its calculation lines.
• Save - if the 'Adding strip' data has not been sawed before, Save runs the Save As option. II the `Ad-ling strip' data is for an 'misting `Adding strip' data filer the data in the Calculation object is saved back to that file without displaying a SaveDialogBox.
• Save As -displays a SaveDialogBox with either the name of the opened file or if it is a new rile being saved, gives a default name 'Calculation1 .cal' . The data in the Calculation object is saved as a text file using the filename the user chooses.
• Print - prints the lines of the calculation object using print preview form to display the printout first and then print if the user chooses to do so.
• Exit - closes the program

7. By default the text file holding the `Adding strip' data will be stored in the 'C:\temp folder on C:drive. This is to be the initial directory of the Open and Save dialogs.

8. The `Adding strip' data files will have a file extension .cal'. This will be used in the Filter and Default extension settings for the Open and save dialogs.

9. The program will detect if the user has made changes after a file is opened, a new fie is created or a file is saved. If there are changes, the user will be given a chance to save their changes before any action takes place that would lose the changes. These actions are New, Open, and Exiting via the menu or closing the main form via the [X] button in the title bar.

10. The program will read data from and save data to tee files assuming the following format:
An operator character, a space and text representing a decimal number unless the operator is # or = in which case there is no fallowing number.
Example:
+1
+2
+3
#
+4
+5
*10
=

Required Tests
This is the minimum number of test cases you need in your testing documentation:
1. Interface displayed correctly when the program runs
2. A simple single operator calculation that handles invalid characters and operations
3. A new calculation can be started
4. An existing fie can be opened
5. A calculation can be saved
6. A calculation can tie sawed as another file
7. A calculation can be printed
8. The program ca n be exited
9. A line can be deleted from a calculation
10. A line can be updated in a calculation
11. A line can be inserted into a calculation
12. Check that Test. files, extension .cal and C:\Temp\ is the default folder
13. A calculation that includes an addition (+) may
14. A calculation that includes a Subtraction (-) only
15. A calculation that includes a Division (/) may
16. A calculation that includes a multiplication (*) only
17. A calculation that includes an addition, a subtraction, a division, a multiplication and a total
18. A calculation that includes a Sub-total and a total
19. A calculation that includes a Total (resell to zero)
20. A calculation that includes 8 operators, 2 sub-totals and a total
21. The user is warned about unsaved data when closing the form.
Please note that your tests can involve more than one step and must be reproducible (i. e explicit test data and user actions) and independent of each other (i.e. please do not use the Output of one test as the input to another test)

Attachment:- Project.rar

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M92844975
  • Price:- $90

Guranteed 48 Hours Delivery, In Price:- $90

Have any Question?


Related Questions in Programming Language

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

Overviewthis tasks provides you an opportunity to get

Overview This tasks provides you an opportunity to get feedback on your Learning Summary Report. The Learning Summary Report outlines how the work you have completed demonstrates that you have met all of the unit's learn ...

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

Task working with arraysoverviewin this task you will

Task: Working with Arrays Overview In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, w ...

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

  • 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