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

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 quarters, dimes, nickels and pennies Labels. See below Form. These variables are Integer type. 5. Use integer division operator () to calculate number of coins. o Integer division examples: 19 15 is 3, 22110 is 2, 1513 is 5,415 is 0. 6. You will use MOD function to calculate the remainders o MOD examples: 19 MOD 5 is 4, 22 MOD 10 is 2, 15 MOD 5 is o (no remainder), 4 MOD 5 is 4. 7. Items to note: 8. variables names must follow the conventions and rules explained in this week's slides and must have proper data type for the values that will be stored in them. i.e., variable name to store TextBox value should be intCents. 9. Appearance of the form is very important: Make sure that your design is clean; Spelling is important. 10. Text property of controls must use the text shown in below Form.
11. Clear Input button, clears TextBox and Labels that display the output. 12. Exit button, closes the Form. 13. You will write the code for the three buttons. 14. Avoid double-clicking on TextBox and Label Controls to create unnecessary code. 15. Run the program, enter values in the TextBox then click Calculate button, you should see the break down of the entered number in Quarters, dimes, nickels and pennies in their corresponding labels. See below screenshot for complete program 16. To save the project, from File, select Save All
Enter a value between 1-99 Quarters Dimes Nickels Pennies Calculate Clear Exit
Enter 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.
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. 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...

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

  • Write a C program that calculates exact change. In order to receive full credit, please remember...

    Write a C program that calculates exact change. In order to receive full credit, please remember that only int arithmetic is exact, so you’ll need to break up your double into two ints, the one before the decimal point and the one after the decimal point. Another point worth mentioning is that the % operator gives the remainder. In other words, when working with int values, 9 / 5 = 1 whereas 9 % 5 = 4. Keep this in...

  • Step One This is the Measurable interface we saw in class; you will need to provide...

    Step One This is the Measurable interface we saw in class; you will need to provide this class; this is it in its entirety (this is literally all you have to do for this step): public interface Measurable double getMeasure(); Step Two This is the Comparable interface that is a part of the standard Java library: public interface Comparable int compareTo (Object otherObject); Finish this class to represent a PiggyBank. A PiggyBank holds quarters, dimes, nickels, and pennies. You will...

  • An Introduction to Programming Using Visual Basic Tenth Edition Chapter 3 Programming Project 3 What is...

    An Introduction to Programming Using Visual Basic Tenth Edition Chapter 3 Programming Project 3 What is the solution to this project? Change X Amount of change: 93 Determine Composition of Change Quarters: 3 Dimes: 1 Nickels: 1 Cents: 3 FIGURE 3.63 Possible outcome of Programming Project 3. own in Fig. 3.62. 3. Change Write a program to make change for an amount of money from 0 through 99 cents input by the user. The output of the program should show...

  • Develop the Change Calculator application In this exercise, you’ll create an application that displays the minimum...

    Develop the Change Calculator application In this exercise, you’ll create an application that displays the minimum number of quarters, dimes, nickels, and pennies that make up the number of cents specified by the user. Without the use of a JavaScript Library (for coins). 1.      Open the HTML and JavaScript files below: 2.      In the JavaScript file, note that three functions are supplied. The $ function. The start of a calculateChange function. And an onload event handler that attaches the calculateChange...

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

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

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