Question

Your app is computing and displaying tax for the user, in the format “Hello John Doe,...

Your app is computing and displaying tax for the user, in the format “Hello John Doe, Your Tax is: ......” , where John Doe is the name entered, and .... indicates the tax amount as a dollar figure.

Your form has two textboxes, where the user will enter his/her name, and income, and click a Submit button.

Your app will store the name entered by the user into a variable of type String, and store the income into a variable of appropriate type.

Within the submit click: Declare a String variable to hold user name, and a variable of appropriate type to hold income. Start off by setting the name to an arbitrary name in the code, and the income to an arbitrary value as well. Later you can update these two lines to read inputs from the textboxes.

Naming style for variables: consult notes; variable names should include a descriptive word and type name. An example: to store price as a double, you would use priceDouble as the variable name.

You assume the tax rate is 15%. Declare variables to hold rate and tax. Choose appropriate type.

You can multiply two numbers x and y like this: Product = x * y

(the multiplication operator is ‘*’ )

Use the name and the tax variables in your output display. You can choose how to display the information (label, message box, or textbox).

Do use a variable to hold the tax rate, instead of using the number directly in computation.


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

Code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Tax_Calculation_Simple
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Double taxRateDouble = 0.15;
private void btnSubmit_Click(object sender, EventArgs e)
{
string nameString;
Double incomeDouble;
Double taxDouble;
nameString = txtName.Text;
incomeDouble =Convert.ToDouble(txtIncome.Text);
taxDouble = incomeDouble * taxRateDouble;
MessageBox.Show("Hello " + nameString + ", Your Tax is: " + taxDouble.ToString("C"));
}
}
}

Design

Output

If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.

Add a comment
Know the answer?
Add Answer to:
Your app is computing and displaying tax for the user, in the format “Hello John Doe,...
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
  • 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...

  • 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...

  • I NEED THE ANSWER IN C++ FORMAT I need the answer In C++ format Your question...

    I NEED THE ANSWER IN C++ FORMAT I need the answer In C++ format Your question has been answered Let us know if you got a helpful answer. Rate this answer Question: Suppose a string variable fullName contains last name of a Suppose a string variable fullName contains last name of a person, followed by a comma, space, and first name Write to the screen a line containing a greeting "Hello <firstName>!", where sfirstName> is the first name taken from...

  • Write a code for a ride tracking app for Large Resort parks. In your app users...

    Write a code for a ride tracking app for Large Resort parks. In your app users are going to be able to track wait times for up to five attractions, find the shortest wait time, and find the average wait time. //-----------------------------Sample Program Behavior with five attractions entered--------------------- Welcome to Large Resort Parks! Please enter the attractions you plan to visit and their wait times Ride 1 info: Attraction Name: 80 ft drop Wait time (in minutes): 40 Enter another...

  • Using Android Studios. Scenario: You recently started working as the mobile app developer for a University...

    Using Android Studios. Scenario: You recently started working as the mobile app developer for a University and have been assigned to build a mobile app that calculates the students' grade. Your app should contain following screens: Screen 1 Labels for subject1, subject2, and subject3 Textboxes for subject1, subject2, and subject3 Labels for MaxGrade, MinGrade, and Avg.Grade Submit button Once user clicks submit button, you need to display letter grade in a label Screen 2 Screen that allows students to register...

  • 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...

  • Write C code to repeatedly ask the user for a number, then once the user enters...

    Write C code to repeatedly ask the user for a number, then once the user enters 0, the code displays the min, max and average of all values entered. To get proper credit, name the variables as listed below and follow the directions carefully. Do not use any break or similar type of statements. To implement the above code, you will need to count the entries - name the counter variable num_count. You will also need to use a variable,...

  • Part 2: Processing Strings (Individual work) Processing user-entered data to follow a specific format is a...

    Part 2: Processing Strings (Individual work) Processing user-entered data to follow a specific format is a common task. Often this involves using string functions to manipulate a set of input strings. Create a MATLAB script named namephone.m and place these lines of code at the beginning: name  = input('Enter your first and last name: ','s'); phone = input('Enter your area code and phone number: ','s'); Tasks Here are useful string functions:  length, strcat, strtrim, lower, upper, strcmp, findstr, strrep As you work...

  • DESCRIPTION Create a C++ program to manage phone contacts. The program will allow the user to...

    DESCRIPTION Create a C++ program to manage phone contacts. The program will allow the user to add new phone contacts, display a list of all contacts, search for a specific contact by name, delete a specific contact. The program should provide the user with a console or command line choice menu about possible actions that they can perform. The choices should be the following: 1. Display list of all contacts. 2. Add a new contact. 3. Search for a contact...

  • Y F G Prompt and Store. 5. Prompt the user with "Enter your weight in pounds:...

    Y F G Prompt and Store. 5. Prompt the user with "Enter your weight in pounds: "message and store in the weight variable. 6. Initialize an int variable named heightIn Inches to feet OſHeight times 12 plus Inches OfHeight. 7. Initialize a double variable named BMI to weight * 703.0 heightIrinches El VB 8. Initialize a double variable named ratio to height In Inches? 703.0 9. Initialize a double variable named lower Normal to 18.5 times ratio. 10. Initialize a...

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
ADVERTISEMENT