Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Microsoft Visual Studios 2015 or 2017, create a C++ GUI Application that meets the following requirements given below: The initial screen when the project

Using Microsoft Visual Studios 2015 or 2017, create a C++ GUI Application that meets the following requirements given below:

The initial screen when the project is executed is shown below.

image text in transcribed

Create a new CLR Empty Project called 'Counter' in some location of your C: drive.

From Solution Explorer of Visual Studio, you should see Solution 'Counter' followed by the project Counter. Out of Visual Studio and using Windows File Explorer, you should see the solution folder 'Counter' at the location you specified. Open it and there should be a project folder 'Counter' with solution file and others.

This Counter project requires to use a Windows Form named MyForm to perform functions described below. A sample of Counter.exe is provided above to help you to develop this project. It's your selection on the size, color, location, and name of each control (or object) as long as your Counter meets the following requirements.

1. The form's title should display 'Programming Assignment 2'. Hint: Text property

2. The form contains seven controls including three buttons, three labels, and one timer. One of the three that only displays 'Time out!' or 'Counter stops!' when necessary, otherwise, it is not visible. One way to make a label "invisible" is by setting its Text property to an empty string, ie, "".

3. When Counter is executed, the top label shows "01:40" for one minute and 40 seconds total time, the middle large label shows "100" and nothing else happens until the Start is clicked.

4. Whenever Start is clicked, the time label updates to display one second less than its current value with a frequency of one update per second.

5. Both 'minute' and 'second' of the time label always display in 2-digit form like '36' or '05'.

6. While the time label is updating its display, the large label in the middle of the form also updates automatically by one less than the value in last second and it must always display in 3-digit form like '098', '003' or '000'.

7. Stop button, once clicked, will stops both updates of the top two labels and Start resumes the updates from where they were stopped.

8. Reset button always resets the middle counter label to '100' anytime (either the Counter is counting or stopped) when it is clicked. However, it never resets the time label.

9. Without intervention, both of these two labels will keep updating and displaying until they become "00:00" and "000", respectively. The update should stop automatically at this moment, so neither will become negative. The third label at the bottom should show a short message of "Counter stops!" once the large count label reaches "000".

10 When counter stops and the above message is displayed, hitting Start button would not start the counter because it never counts negative numbers.

11. When counter stops because of time is "00:00", clicking on Reset only forces the counter label to display "100". Pressing the Start button only gets the bottom message changes to "Time out!", which is the message always displayed when the time label is updated to "00:00" no matter what counter label contains, "000" or others.

12. User intervention to the counting is possible by the following two events: (a) Clicking directly on the large counter label, which will force the counter to decrement five (ie, -5) from its current count. (b) Double clciking on the form, but not any controls, will force the counter to decrement ten (ie, -10) from its current count.

13. Remember the counter never counts to negative, so 12(a) and 12(b) only work if the current count is large enough to decrement 5 or 10. If not, nothing occurs to 12(a) and 12(b) events.

Additional hints:

(i) If the length of a string like a label's display is needed, use Length property. For example, if labAnswer is a label control, labAnswer->Text->Length returns the length of its display as an integer because labAnswer->Text results a String object and any String object has a Length property.

(ii) If a variable of some type (e.g., int, double, short, float, etc.) is needed, you may declare it within a method, if a local variable is needed, or, out of any method but some where inside the MyForm class, if a "golbal" variable to all methods is needed. For example, if an integer variable 'total' needs to be shared and accessed by more than one methods, you must declare it out of any methods but within the MyForm class. You can scroll up the editing space to find lines as below and declare it there with initial value of zero.

private: ///

/// Required designer variable. /// int total = 0;

Programming Assignment21 01:40 100 Start Stop Reset Programming Assignment21 01:40 100 Start Stop Reset

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions