Question

Use visual studios language C++ to creat Form1 and Designer Form for question below 3. Form...

Use visual studios language C++ to creat Form1 and Designer Form for question below

3. Form has three textboxes, two for input and one for output. Form also has five buttons, marked, ‘+’, ‘-’, ‘*’, ‘/’, ‘C’ respectively.

User enters integers into the two textboxes, and clicks one of the four buttons (+, - , *, /). The third textbox shows the result of the corresponding operation. For example, if user entered 10 into the first textbox and 2 into the second textbox, and clicked the * button, 20 will display in the third textbox.

For division, the result should display with three digits after the decimal point. (This is graded based on your code, not on the number of digits actually displayed, which may vary depending on the inputs)

The ‘C’ button will get the form ready for the next set of inputs.

You can assume that the user will never enter 0 into the second textbox.

No error checking is expected.

You can assume that the user will not leave a textbox empty.

Layout of the controls - you can choose.

If the user presses Enter after typing in the two inputs, the sum should be displayed.

If the user presses Esc, the form should get ready for the next set of inputs.

Enter and Esc refer to the Enter key and Esc key on your keyboard, respectively.

You may attempt simple methods without risking any loss of points for errors in how you create and use them.


0 0
Add a comment Improve this question Transcribed image text
Answer #1

<!-- Javascript for multipication -->
<script language="javascript" type="text/javascript">
function multiply(){
a=Number(document.my_cal.first.value);
b=Number(document.my_cal.second.value);
c=a*b;
document.my_cal.total.value=c;
}
</script>

<!-- Javascript for addition -->
<script language="javascript" type="text/javascript">
function addition(){
a=Number(document.my_cal.first.value);
b=Number(document.my_cal.second.value);
c=a+b;
document.my_cal.total.value=c;
}
</script>

<!-- Javascript for subtraction -->
<script language="javascript" type="text/javascript">
function subtraction(){
a=Number(document.my_cal.first.value);
b=Number(document.my_cal.second.value);
c=a-b;
document.my_cal.total.value=c;
}
</script>

<!-- Javascript for division -->
<script language="javascript" type="text/javascript">
function division(){
a=Number(document.my_cal.first.value);
b=Number(document.my_cal.second.value);
c=a/b;
document.my_cal.total.value=c;
}
</script>

<!-- Opening a HTML Form. -->
<!-- <form name="my_cal"> -->

<form name="my_cal">
  
<!-- Here user will enter 1st number. -->
Number 1: <input type="text" name="first">
  
<!-- Here user will enter 2nd number. -->
Number 2: <input type="text" name="second">

<!-- Here result will be displayed. -->
<br>Result:<input type="text" name="total"> </br>

<form onreset>
<input type="button" value="+" onclick="javascript:addition();">
<input type="button" value="-" onclick="javascript:subtraction();">
<input type="button" value="*" onclick="javascript:multiply();">
<input type="button" value="/" onclick="javascript:division();">
<input type="reset" value="C">
</form>

</form>

Add a comment
Know the answer?
Add Answer to:
Use visual studios language C++ to creat Form1 and Designer Form for question below 3. Form...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a Visual C# program that will input the user's name and a message. The user...

    Write a Visual C# program that will input the user's name and a message. The user will be able to choose from an option of formatting tools to change the way the message (and only the message) will look. The user can choose from bold, underline, italic, along with several different color options. All changes the user selects will be displayed in the message textbox. Once the user selects the Finish button, the two pieces of information entered by the...

  • Using C#: Create a Form that consists of 3 radio buttons, two textboxes, a label and...

    Using C#: Create a Form that consists of 3 radio buttons, two textboxes, a label and a button. The three radio buttons should represent the names of three fonts, e.g. “Arial”, “Calibri” and “Times New Roman”. In the one textbox, a user should type a message and in the other textbox, the user should type a size. When the user clicks the button, the label should be updated with the text the user typed in the one textbox, using the...

  • Visual Studio Code C# Well Document everyline saying what the code does. Include designer code and...

    Visual Studio Code C# Well Document everyline saying what the code does. Include designer code and .cscode Extra 6-1 Create a simple calculator In this exercise, you'l1 create a form that accepts two operands and an operator from the user and then performs the requested operation. Simple Calculator Operand 1: 86 Operator Operand 2 11.11 Resut 7.7408 1. Start a new project named SimpleCalculator in the Extra Exercises Chapter 06SimpleCalculator directory 2. Add labels, text boxes, and buttons to the...

  • Create an order entry screen program in C# to give a total for an individual pizza...

    Create an order entry screen program in C# to give a total for an individual pizza order. The Pizza order should have radio buttons for small $7, medium $9, and large $12 choices for the pizza. There should be a checkbox for drink (where a drink is $2 added if it is checked and nothing added if it is not checked. Include a textbox for the customer’s name. Have a button to calculate the subtotal (pizza choice and whether there...

  • Visual Basic You are asked to develop a Visual Basic Net application that can determine roots...

    Visual Basic You are asked to develop a Visual Basic Net application that can determine roots of a requirements of this project are as follows: 1) Design a form to allow users to define a quadratic equation and to find the roots of the equation. The form should have a label that shows this message: Solving a quadratic equation ax2+bx+c=0 The form should have three textboxes in which users enter the values of a, b, and c The form should...

  • Visual Basic Programming Step 1-2 not important, it's just file naming. 3. Form contains nine Labels,...

    Visual Basic Programming Step 1-2 not important, it's just file naming. 3. Form contains nine Labels, one TextBox, and three Button controls. You use labels to let user know what to enter and what will be displayed; TextBoxes to input a number between 1 and 99. Buttons to Calculate change. Clear Input and Exit program. See below Form Layout with Controls for more details 4. Declare variables to store the entered value in TextBox, and what will be displayed in...

  • Project 2 Description Create a Visual C# project that when an employee's biweekly sales amount is...

    Project 2 Description Create a Visual C# project that when an employee's biweekly sales amount is entered and the Calculate button is pressed, the gross pay, deductions, and net pay will be displayed. Each employee will receive a base pay of $1200 plus a sales commission of 8% of sales. Once the net pay has been calculated, display the budget amount for each category listed below based on the percentages given.         base pay = $1200; use a named...

  • Create a Wpf application Use Visual Studios 2019 A shipping company receives packages at its headquarters,...

    Create a Wpf application Use Visual Studios 2019 A shipping company receives packages at its headquarters, which functions as its shipping hub. After receiving the packages the company ships them to a distribution center in one of the following states: Alabama, Florida, Georgia, Kentucky, Mississippi, North Carolina, South Carolina, Tennessee, West Virginia or Virginia. The company needs an application to track the packages that pass through its shipping hub. The application generates a package ID number for each package that...

  • Programming language "Visual C# (C# - similar in syntax to Java," Your form accepts six inputs...

    Programming language "Visual C# (C# - similar in syntax to Java," Your form accepts six inputs from the user, all of them being information about individual students in a class. The first input is the student’s name. The next three are homework scores, each score being out of 50. The last two are test scores, each score being out of 30. (These scores can have fractional parts; a score like 10.5 is possible) Use textboxes to collect the inputs. The...

  • Visual Basic Programming Step 1-2 not important, it's just file naming.

    Visual Basic Programming Step 1-2 not important, it's just file naming. 3. Form contains nine Labels, one TextBox, and three Button controls. You use labels to let user know what to enter and what will be displayed; TextBoxes to input a number between 1 and 99. Buttons to Calculate change. Clear Input and Exit program. See below Form Layout with Controls for more details 4. Declare variables to store the entered value in TextBox, and what will be displayed in...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT