Question

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 what11. Clear Input button, clears TextBox and Labels that display the output. 12. Exit button, closes the Form. 13. You will wriEnter a value between 1-99 Quarters Dimes Nickels Pennies Calculate Clear ExitEnter a value between 1-99 47 Quarters Dimes Nickels 0 Pennies Calculate Clear Exit

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

Don't forget to give rating if you like the code.

Form design Screenshot:

Forml.cs* 1.Cs T Forml.cs [Design) orm.cs IDesignX + X Form Enter a Value between 1-99 Quarters Dimes Nickels Pennies Calcul

Program:

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 ChangeCalculator
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
//declaring variables for quarters, dimes, nickels and pennies
int quarters, dimes, nickels, pennies,leftover;
//converting text to integer
leftover = Convert.ToInt32(textBox1.Text);
  
//code to calculate Quarters
quarters = leftover / 25;
leftover = leftover Mod 25;
//displaying number of quarters in a textbox
tquarters.Text = quarters.ToString();

//code to calculate dimes
dimes = leftover / 10;
leftover = leftover Mod 10;
//displaying number of dimes in a textbox
tdimes.Text = dimes.ToString();

//code to calculate nickels
nickels = leftover / 5;
leftover = leftover Mod 5;
//displaying number of nickels in a textbox
tnickels.Text = nickels.ToString();

//code to calculate pennies
pennies = leftover;
//displaying number of pennies in a textbox
tpennies.Text = pennies.ToString();

}

  

//code for clear Button(clears all fields on button click)
private void clear_btn(object sender, EventArgs e)
{
textBox1.Clear();
tquarters.Clear();
tdimes.Clear();
tnickels.Clear();
tpennies.Clear();
}

//code for exit button(Exits the entire form)
private void exit_btn(object sender, EventArgs e)
{
this.Close();
}

}

}

Output:

Screenshot of output

Form1 Enter a Value between 1-99 47 Quarters 2 Dimes Nicikd Pennies 2 Calculate Clear Exit

Screenshot for clear button:

Form1 Enter a Value between 1-99 Quarters Dimes Pennies Calculate Clear Exit

Add a comment
Know the answer?
Add Answer to:
Visual Basic Programming Step 1-2 not important, it's just file naming. 3. Form contains nine Labels,...
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...

  • it c++ coding. please write on atom software. 1. Write a program that converts dollars into coins a. Request a dolla...

    it c++ coding. please write on atom software. 1. Write a program that converts dollars into coins a. Request a dollar amount as an integer: $5.34 is input as 534 b. Use a constant variable to represent each coin as a fixed value: const int NICKEL 5; c. Use division and the mod function to calculate the number of each coin. Change Calculator Enter dollar amount (as an integer): $534 The equivalent in coins: 21 Quarters 0 Dimes 1 Nickels...

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

  • Your program must meet the following specifications: 1. At program start, assume a stock of 10 nickels, 10 dimes, 10...

    Your program must meet the following specifications: 1. At program start, assume a stock of 10 nickels, 10 dimes, 10 quarters, and 10 pennies. 2. Repeatedly prompt the user for a price in the form xX.xx, where X denotes a digit, or to enter q' to quit 3. When a price is entered a. If the price entered is negative, print an error message and start over requesting either a new price or to quit (indicated by entering a 'q)...

  • Programming question. Using Visual Studio 2019 C# Windows Form Application (.NET Framework) Please include code for...

    Programming question. Using Visual Studio 2019 C# Windows Form Application (.NET Framework) Please include code for program with ALL conditions met. Conditions to be met: 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...

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

  • create an application in VISUAL BASIC that calculates a cars gas mileage. The formula for calculating...

    create an application in VISUAL BASIC that calculates a cars gas mileage. The formula for calculating the miles that a car can travel per gallon of gas is MPG = Miles/Gallon In the formula MPG is miles-per-gallon, miles is the number of miles that can be driven on a full tank of gas, and gallons is the number of gallons that the tank holds. The applications form should have TextBox controls that let the user enter the number of gallons...

  • Write a program that tells what coins to give out for as change from 1 cent...

    Write a program that tells what coins to give out for as change from 1 cent to 99 cents. Use coin denominations of 25 cents (quarters), 10 cents (dimes), and 1 cent (pennies) only. Include a loop that lets the user repeat this computation for new input values until the user says he or she wants to end the program. Solution Demo Hello I am the coin machine! I will give you the least number of coins for your change....

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

  • ELEC 1520 Homework - Integer Operations, Selection Statements Instructions Write C++ programs to solve the following...

    ELEC 1520 Homework - Integer Operations, Selection Statements Instructions Write C++ programs to solve the following two problems. Upload your source code files to Canvas. The file names must be of the form coins_your_name.cpp and bonus_your_name.cpp for problems 1 and 2, respectively. Substitute your first and last name for "your_name" in the file name. Problem Statements 1. Given a value V in cents, you need to make change using a minimum number of coins. Assume you have an infinite supply...

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