Question

Programming question. Using Visual Studio 2019 C#

Windows Form Application (.NET Framework)

Please include code for program with ALL conditions met.

Word Problem A person inherits a large amount of money. The person wants to invest it. He also has to withdraw it annually. H

Controls required are as follows: -Buttons, (Radio Buttons or Check Boxes; you must make a good decision which to use), List

Conditions to be met:

- The program runs without errors. -The program generates a desired output. - The program validates users input. -The progra

Word Problem A person inherits a large amount of money. The person wants to invest it. He also has to withdraw it annually. How many years will it take him/her to spend all of the investment that earns at a 7% annual interest rate? Note that he/she needs to withdraw $40,000.00 a year. Also there is an inflation rate that must be considered in a calculation. Create a C# project that allows the user to enter an inherited amount. If it is not entered, the program will display an error message. There must be two options on the form for the user to select an inflation rate percentage: Option 1: 3% inflation rate Option 2: 4% inflation rate Here are additional conditions: 1. If the inherited amount is less than or equal to $40,000.0, the message"You will need it this year. No investment needed." Otherwise, a calculation will be performed. 2. When the form is loaded, a relevant picture is loaded to the top left of the form with a welcome message "Welcome to Inheritance calculator". Any picture would be fine actually. 3. After the user selects an inflation rate and enter an inherited amount and a calculate button is clicked, then a list of details in the following format will be displayed: inflation rate. Your investment starts at $ and earn 7% a year. You withdraw $40,000 a year. You have chosen a Year Interest earned Balance 2015 2014 0 (This could be a negative value too.) It takes you years to spend all of your inheritance.
Controls required are as follows: -Buttons, (Radio Buttons or Check Boxes; you must make a good decision which to use), List Box, Textboxes, labels, PictureBoxes, and GroupBoxes.
- The program runs without errors. -The program generates a desired output. - The program validates user's input. -The program contains named constants. -The program uses at least one loop. -The program uses conditions. -The program uses appropriate variables and data types. -The program is easy to read (indentation) -The program contains a form with controls required.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code:

//Include libraries

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;

//Define namespace

namespace WindowsFormsApplication5

{

//Define a class

public partial class Form1 : Form

{

//Define a constructor

public Form1()

{

//Initialize

InitializeComponent();

}

//Define a method

private void label1_Click(object sender, EventArgs e)

{

}

//Define a method

private void button1_Click(object sender, EventArgs e)

{

//If no value is given

if (TextBox1.Text == "")

{

//Display message

MessageBox.Show("amount is empty.");

}

//Otherwise

else

{

//Convert to double

double amt = Convert.ToDouble(TextBox1.Text);

//If amount is less than 40000

if (amt <= 40000)

{

//Display message

MessageBox.Show("You will need it this year. No investment needed.");

}

//Otherwise

else

{

//Declare variable

int year = 2015;

//Declare variable

double inr;

//If button checked

if (radioButton1.Checked)

//Declare variable

inr = 0.03;

//Otherwise

else

//Set value

inr = 0.04;

//Declare variable

String output;

//Display result

output = "You have chosen a " + (inr * 100) + "% inflation rate.";

//Display result

output += "\n\nYour investment starts at $" + amt + " and earns 7% a year.";

//Display result

output += "\n\nYou withdraw $40,000 a year.\n";

//Display result

output += "\nYear\tIntrest Earned\tBalance\n";

//Loop

while (amt > 0)

{

//Add 7% in amoujnt

amt = (amt - 40000) + ((amt - 40000) * 0.07);

//Update amount

amt = amt - (amt * inr);

//Display result

output += "\n" + year + "\t" + amt + "\t" + (amt - 40000) + "\n";

//Decrement

year--;

}

//Display result

output += "\nIt takes you " + (2015 - year) + " years to spend all of your inheritance.";

//Display output

MessageBox.Show(output);

//Close

this.Close();

}

}

}

}

}

Forml Enter an nheted anourt 30000 a3% Hton Rate 4 ton Rate Calculate You have chosen a 3 % inflation rate Your investment st

Add a comment
Know the answer?
Add Answer to:
Programming question. Using Visual Studio 2019 C# Windows Form Application (.NET Framework) Please include code for...
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
  • This C++ Program should be written in visual studio 2017 You are to write a program...

    This C++ Program should be written in visual studio 2017 You are to write a program that can do two things: it will help users see how long it will take to achieve a certain investment goal given an annual investment amount and an annual rate of return; also, it will help them see how long it will take to pay off a loan given a principal amount, an annual payment amount and an annual interest rate. When the user...

  • I need help modifying this code please ASAP using C++ Here is what I missed on this code below Here are the instruction...

    I need help modifying this code please ASAP using C++ Here is what I missed on this code below Here are the instructions Here is the code Produce correct70 pts O pts Full Marks No Marks results and statisfy requirements view longer Comments 1. Your display amount is not readable 2. I withdraw more than my balance, but I didn't see any error message description Documentations10 pts 0 pts Full Marks No Marks : comment i code and block comment...

  • This is in C++ (using IDE Visual Studio). I am seeking assistance ASAP. Please include a...

    This is in C++ (using IDE Visual Studio). I am seeking assistance ASAP. Please include a static member in the class to automatically assign account numbers (used to process up to 10 accounts) and have the user include their first and last name. Thank you! 13. a. Define the class bankAccount to store a bank customer's account number and balance. Suppose that account number is of type int, and balance is of type double. Your class should, at least, provide...

  • Using C# Language Develop a Visual C# .NET application that performs a colour control operation. The...

    Using C# Language Develop a Visual C# .NET application that performs a colour control operation. The main form contains a reset button and sets the form's background colour according to the colour values indicated by the colour control objects. Each colour control object is controlled by a corresponding colour control form which provides a progress bar to show the value (in the range 0 to 255) of the corresponding colour control object. The user can click the increase (+) or...

  • I need help writing this code in C++ and I’m using xcode for mac the objective...

    I need help writing this code in C++ and I’m using xcode for mac the objective is in the first picture and the rest is a sample output of the code thaf needs to be similar bjectives: . Perform C++ string object manipulation Understand how to manipulate data using arrays of structs Handle input errors and invalid values Design and create a wel-structure program using C++ basic programming constru Description: Write a menu-driven program that provides the following options 1....

  • Question 1 (Marks: 50 Develop a Java GUI application that will produce an investment report based...

    Question 1 (Marks: 50 Develop a Java GUI application that will produce an investment report based on various criteria, such as investment amount, investment type and term. On the form create two text fields, one to capture the customer name and (10) Q.1.1 another to capture the amount to invest. Also create a combo box for the user to select the investment type which will be moderate or aggressive. Finally add three radio buttons for the user to select the...

  • Can you solve this proble by using C# application? C# is one of programming languages supported...

    Can you solve this proble by using C# application? C# is one of programming languages supported by Visual Studio 2015. It combines the features of Java and C ++ and is suitbale for rapid application development. A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected. The state sales tax rate is 4% and the county sales tax rate is 2%. Create an...

  • If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but...

    If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but minor discrepancies may require you to adjust. If you are attempting this assignment using another version of Visual Studio, you can expect differences in the look, feel, and/or step-by-step instructions below and you’ll have to determine the equivalent actions or operations for your version on your own. INTRODUCTION: In this assignment, you will develop some of the logic for, and then work with, the...

  • Need some help with this C++ code. Please screenshot the code if possible. Purpose: Demonstrate the...

    Need some help with this C++ code. Please screenshot the code if possible. Purpose: Demonstrate the ability to create and manipulate classes, data members, and member functions. This assignment also aims at creating a C++ project to handle multiple files (one header file and two .cpp files) at the same time. Remember to follow documentation and variable name guidelines. Create a C++ project to implement a simplified banking system. Your bank is small, so it can have a maximum of...

  • Can you please help me with creating this Java Code using the following pseudocode? Make Change C...

    Can you please help me with creating this Java Code using the following pseudocode? Make Change Calculator (100 points + 5 ex.cr.)                                                                                                                                  2019 In this program (closely related to the change calculator done as the prior assignment) you will make “change for a dollar” using the most efficient set of coins possible. In Part A you will give the fewest quarters, dimes, nickels, and pennies possible (i.e., without regard to any ‘limits’ on coin counts), but in Part B you...

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