The first programming project involves writing a program that parses,

Project 1

Instructions

 

The first programming project involves writing a program that parses, using recursive descent, a GUI definition language defined below and generates the GUI that it defines. The grammar for this language is defined below:

gui ::=

    Window STRING ‘(‘ NUMBER ‘,’ NUMBER ‘)’ layout widgets End ‘.’

layout ::=

    Layout layout_type ‘:’

layout_type ::=

    Flow |

    Grid ‘(‘ NUMBER ‘,’ NUMBER [‘,’ NUMBER ‘,’ NUMBER] ‘)’

widgets ::=

    widget widgets |

    widget

widget ::=

    Button STRING ‘;’ |

    Group radio_buttons End ‘;’ |

    Label STRING ‘;’ |

    Panel layout widgets End ‘;’ |

    Textfield NUMBER ‘;’

radio_buttons ::=

    radio_button radio_buttons |

    radio_button

radio_button ::=

    Radio STRING ‘;’

In the above grammar, the red symbols are nonterminals, the blue symbols are tokens and the black punctuation symbols are BNF metasymbols. Among the tokens those in title case are keywords. The character literals are punctuation tokens.

Below is an explanation of the meaning of some of the symbols in the above productions that should help you understand the actions that are to be performed when each of the productions is parsed:

In the window production the string is name that is to appear in the top border of the window and the two numbers are the width and height of the window

Languages (2165) – UMUC Learning Management System

In the production for layout_type that define the grid layout, the first two numbers represent the number of rows and columns, and the optional next two the horizontal and vertical gaps

In the production for widget that defines a button, the string is the name of the button

In the production for widget that defines a label, the string is text that is to be placed in the label

In the production for widget that defines a text field, the number is the width of the text field

In the production for radio_button, the string is the label of the button

You parser should properly handle the fact that panels can be nested in other panels. Recursive productions must be implemented using recursion. Syntactically incorrect input files should detect and report the first error.

Below is an example of an input file:

Window “Calculator” (200, 200) Layout Flow:

  Textfield 20;

  Panel Layout Grid(4, 3, 5, 5):

    Button “7”;

    Button “8”;

    Button “9”;

    Button “4”;

    Button “5”;

    Button “6”;

    Button “1”;

    Button “2”;

    Button “3”;

    Label “”;

    Button “0”;

  End;

End.

The above input file should produce the GUI shown below:

You may use any programming language of your choice, examples are Java, or C++, or C# etc.

 

Submit the following as the task requirement:

1. Write up, or explanation on your approach. Write a paragraph, or two on this.

2. Write up, or explanation on any assumption that you have made. Write a paragraph, or two on this.

3. Write up, or explanation on functions that you were not able to implement. Explain challenges faced, and effort you made to resolve it. Write a paragraph, or two on this. Consider this your way to defend yourself and explain the effort made.

4. Write up on lessons learned. Write a paragraph, or two on this.

5. Write up on ways to improve it. Improvement could be something you could have done different, but was not able to do because of scope, or time did not permit, functions that you were not able to implement and the reason for not doing so, a different way of approaching the problem etc. Write a paragraph, or two on this.

6. Include the source code that you have written. Copy and paste it in the MS Word document.

7. Write up test conditions that you have tested. If you have tested for any positive condition (conditions that pass the program), or negative test (conditions that will make the program not perform), explain those scenarios.

8. Include screen shots of user interfaces generated while you tested the program. For example, when you run the program, you will receive GUI output, or console output. Include screen shot of each test run of the GUI output to support successful running of the program.

In a single MS Word file, include:

1. Above answers, number your answers please.

2. Include relevant screen shots showing test runs

3. Copy and paste of the source code that you have written

Name the MS Word document as lastname_firstname_project1 and upload that single MS Word document in the submission area.

 

Also, upload separate file (e.g. a zip file ) containing your source code in the submission area. For example, if you wrote the code in Java, only include the .java files, do not include .class files. It is understood that you are doing both upload of the source code and copy and paste of it MS Word file.  

 

You may use StringTokenizer class, if you are using Java.  Radio buttons are just those calculator buttons with number 1, 2, 3 etc. Those numbers in calculator are defined as buttons. As a user would press a button, it will get displayed on the text box on the top. Understand that it is NOT a full blown implementation of a calculator in this project 1. Project 1 only lays out the foundation of the calculator. For that matter, we do not implement buttons as “Add”, “Subtract” etc. in Project 1 yet. We leave them for project 2. The input will be read from keyboard only, not from any input file.

 

 

Calculate Your Essay Price
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more