Prepare a basic four function calculator

Assignment Help Visual Basic Programming
Reference no: EM131041568

Project

Your project will consist of programming a basic 4 function calculator with an on and off button. Such task usually primitive and essay to implement however the thing that will make it a challenge is to correctly utilize the Graphical user Interface to simulate a device from real life.

States

On and Off

As you might have noticed, the calculator can either be tamed on, or fumed off. If the calculator is turned on then actions or events will have to he handled as they occur, however if the calculator is turned off nothing should happen (as in no clicks or button events should register or display some form of change) unless the on button is pressed. To do this you will need to simulate an on and off state, which .n be distinguished with a Boolean value. To make use of that value, you will need to declare it at the class level (the b.) and initialize ifs value once the form launches.

407_On and Off Status.png

Value held by display

Like Me On and Off states that need to be programmed, you will also need to change what is displayed when you input a new value. The default value that should be displayed when the calculator is fumed on is V. but you can't have your value start with a "0" can you? To overcome this problem, you will need to make two different states that determine what the display (label) should hold. A transition states that either displays the previous value or a O. and an input state that displays. value being inputted each time a Mon b pressed. So, basically you sled at the transition state when you tam on the calculator or click one of the 0 functions. Men you start inputting numbers, the state changes from transition to input.

1260_Valuse held by display.png

Logic

Instance variable (instance level scope) current value

You should have a variable that stores the value of your calculation every time you need to input a new number.

A instance level Function and Variable to determine the operation needed every time an operation is activated

Make a function that takes in a variable declared at the Instance level which determines the operation to be made, and current value so that the result Is shown on the display every time a function Is activated

Avoiding multiplication on 0 when re/initializing the calculator.

When you ...turn on the calculator the default value is O. If you want to do a multiplication operation on Nat zero then you will have to add N. zero to whatever number you input. In other wo.s, the default value is zero and the default operation is add.

Buttons and events

Buttons 1-9:

If ofr do nothing

else

if in transition state: Clear the display and append the it's text with the number represented by the button then change the stale from transition to input

else: just append the display

Button 0:

If Off do nothing

else

if transistion state set display to display only "0".

else append the display with zero

Button (function x + - / = ):

If off do nothing

else

If transition state stay In transition state and don't change

else compute the value based on current value and input value (and previous operation)

Button ON

If state is off then initialize the calulator to default settings else do nothing

Button OFF

If state Is OFF then do nothing

else: clear display and charge state to off

Button C

If ON state Clears everything and initializeto default settings else do nothing

Button CE

If ON state Clear the current entry to (but not the current calculated value)

What it should look like in the end.

It should look something like this. Doesn't have to be exact so get trestive

2469_Calculator.png

Reference no: EM131041568

Questions Cloud

Do you think same sex marriage should be legal : The US Supreme Court has ruled that same sex marriage is legal nationwide since June 6, 2015. However, the new law does not stop the battles of gay marriage across America. Do you think same sex marriage should be legal? Please state your own posi..
The social movement of time and place : This week we're reading across disciplines: history, philosophy, music, art, Europe, America, Asia...welcome to the Humanities. Hence our discussion will focus on influences. How does history, the social movement of time and place, influence art?
Who will benefit from growth focussed more on consumption : According to the article, China's growth is slowly become better balanced. Use the national income accounting identity (Y = C + I + G + NX) to explain what is meant by better balanced growth. Who will benefit from growth focussed more on consumption
Is there a difference between poetry and verse : Is "Roses are red/ Violets are blue/ Sugar is sweet/ And so are you!" poetry? Why or why not? What, in other words, makes a group of words a "poem"? Is there a difference between "poetry" and "verse"? If so, what do you think it is?
Prepare a basic four function calculator : Your project will consist of programming a basic 4 function calculator with an on and off button. Such task usually primitive and essay to implement however the thing that will make it a challenge is to correctly utilize the Graphical user Interfa..
Improve efficiency of processes : Reliability and sustainability needs of our hospitality clients who, in turn, rewards us with profits that will allow our stakeholders and the communities in which we operate to prosper.
How they participate in the production of collective memory : summarize only relevant research key paradigms, modelstheories, approach. identify the limitations of past research on the question, specify the relevant contributions on which your research is built
Conducting a business or not and their likely decision : LAWS20023Australian Taxation Law - Advise Brigitte as to whether she will be a resident of Australia for income tax purposes for the 2015/16 income year.
Discuss the ethical acceptability of the commission payment : Discuss the ethical acceptability of the three types of payments (commission, facilitation payment or a bribe)

Reviews

Write a Review

Visual Basic Programming Questions & Answers

  Designing vb applications across multiple platforms

Technical Project "Designing VB Applications Across Multiple Platforms". This assignment will contain two (2) Parts: Written Paper and Visual Basic Prototype. The Visual Basic Prototype is not included in the total page count but is included in the e..

  Visual basic programming discussion

The use of decision logic is one of the major concepts of computer programming. The decision takes your code from being sequential to one that can take various options based on the different conditions. Determine the method of coding that you would u..

  Ticketseller

Use Visual basic 2010Visual Basic,  TicketSeller. This assignment will contain two (2) Parts: Event Planning Document and Coding phase. You must submit both parts as separate files for the completion of this assignment. Remember, you are only to de..

  Data storage & "exception error trapping"

Discussion on Data Storage and  "Exception Error Trapping".

  Designing vb applications across multiple platforms

Technical Project "Designing VB Applications Across Multiple Platforms".

  The implementation of server side of the application

Implementation of dynamic content, server side (backend) and database for your web site using Microsoft Visual Studio 2012

  Need help building a vwd website

Need help building a VWD website. This website may not go live. I have little progress as a family tragedy has impeded my time for school.

  To develop a visual basic console application

The aim of the assessment is to develop a Visual Basic console application that performs a number of mathematical functions. The mathematics package will be menu driven, i.e. a number of options will be displayed, and the user will be able to input w..

  Program in basic which prompts user to input two integers

Write down the program by using Small Basic which prompts the user to input two integers: firstNum and secondNum (firstNum must be less than secondNum).

  Develop vb-net application that includes arrays and loops

Develop a VB.NET application that includes arrays, loops, and IF statements to do the following. Your output must also display the number of applicant(s) being interviewed.

  Visual basic program to accept numeral values

Write a VISUAL BASIC program to accept numeral values of any unit, sum up the total, calculate the average, and then Output the result with a proper unit.

  Write a visual logic program to accept series of number

Write a Visual Logic program which accepts a series of numbers, until the first negative value is entered. The maximum number of non-negative input values is 250.

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