What operator was last clicked as well as the running total

Assignment Help Other Subject
Reference no: EM133476208

Assignment: A Working Calculator for Multiplication & Addition Project

Instructions

You will complete a program to demonstrate the skills presented in this lesson for your selected language path. Please keep in mind that with all the assignments in this course, any given scenarios are hypothetical and intended solely to demonstrate specific skills.

Using the language in which you have chosen to focus: C#, Java, Web Development language (JavaScript), please complete the following Assignment: I HAVE CHOSEN C#.

You will create a GUI calculator program that will offer the user a button to clear the values, buttons for all digits 0 through 9, as well as the operator buttons for multiplication, division, addition, subtraction, and equal. The user should be able to click the various digit buttons and have them display combined as a single number in a textbox or label control. (e.g., if the user clicks the 2, 4 and 7 buttons successively the textbox or label should display 247) If the user clicks on an operator button the current value must be included in the running total based on the last operator button clicked. If no operator button has been clicked since the start of the program or since the last time the clear button has been clicked, then the current value will be added to the total by default. When the equal button is clicked, the current value will be added or subtracted from the total per the previous operator button and then the final total will be displayed in the textbox or label. Note: As mentioned, you can choose to use either a textbox or a label control for displaying data but whichever you choose, only one should be used. (All of this mimics a standard calculator that you have used before.)

Task

Your program should display a form with either a textbox or label control across the top. Below that, the form should display the buttons described in the assignment description above. (You might want to look and the Windows Calculator or the calculator app on your phone for an example of the layout.)

Name all of your controls suitable names. Hint: prefixes can make control names easier to distinguish one from the other. Examples include cmd for command button, txt for textbox, and lbl for label. Standard naming conventions are common in the software development field.

All buttons should be the same size and neatly aligned in a grid pattern below the textbox/label. How you layout the grid is up to you but I would recommend sticking with the standard pattern for calculators. If you would like your operator buttons to be a different size from your digit buttons that is fine but all operator buttons should be the same size and all digit buttons should be the same size. All buttons should display their value on their face and be centered.

Define any variables you need to keep up with what operator was last clicked as well as the running total. Hint: This can be done with one variable for the total and one variable to indicate the last operator clicked.

Using events for the buttons, add functionality to each button.

Digit buttons should append their respective digit to the end of the displayed number.

Operator buttons should call for currently displayed value to be added or subtracted per the last operator called and then set the operator "flag" variable to indicate what was just clicked. Either the operator button's code or the next digit button clicked will need to clear the display.

The equal button should call for the last operation to be completed just as the other operators do, then display the final total in the textbox/label control.

The clear button should clear the textbox/label, (either make it blank or make it display 0), as well as reset all variables as they were when the program began.

Reference no: EM133476208

Questions Cloud

Why is the first polarizer necessary : A fluorescence anisotropy experiment requires two polarizers, one before the sample cuvette and one after. Why is the first polarizer necessary
Describe the options for protecting ourselves : Describe the options for protecting ourselves from the heavy metal. Can we prevent them at the source, in the environment, and/or clean them up
What is meant by the terms validity and reliability : What is meant by the terms validity and reliability? What is the difference between the two terms? How do both affect generalizability?
Why divergent thinking is important for children : Why divergent thinking is important for children?
What operator was last clicked as well as the running total : IT 232- Define any variables you need to keep up with what operator was last clicked as well as the running total.
How is learning critical thinking a social process : How is learning critical thinking a social process? Why is it important, in current society, to ensure that our students develop critical thinking skills?
Illustrate importance of a health system in global health : How does the film, Salud illustrate the importance of a health system in global health? Provide 3 examples to support your thesis and evaluation of the film
What does freedom have to do with a meaningful life : What does freedom (or the lack thereof) have to do with a meaningful life? Choose one (and only one) thinker (d'Holbach or James) to discuss in connection with
How are death statistics used on a global level : How are death statistics used on a global level? How do countries share this information?

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd