Question
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 o
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.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Below is the code for this problem. Comments are included so that you understand whats going on. Let me know if you have any doubts or if you need anything to change. Please do give a thumbs up. thanks a lot.

Public Class frmMain
    Private Sub Change_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'disable the textbox on form load
        txtQuarters.Enabled = False
        txtNickels.Enabled = False
        txtDimes.Enabled = False
        txtCents.Enabled = False
    End Sub

    Private Sub btnChange_Click(sender As Object, e As EventArgs) Handles btnChange.Click
        Dim amount As Double 'declaret the variabel
        'check for the correct input
        If Not Double.TryParse(txtAmount.Text, amount) Then
            MessageBox.Show("Enter correct amount")
        Else
            Dim Quarters As Single, Dimes As Single, Nickels As Single, Cents As Single
            'convert the amount to Quarter, dimes, nickles, cents
            Quarters = amount \ 25
            amount = amount Mod 25

            Dimes = amount \ 10
            amount = amount Mod 10

            Nickels = amount \ 5
            amount = amount Mod 5

            Cents = amount

            'display to textbox
            txtQuarters.Text = Quarters
            txtNickels.Text = Nickels
            txtDimes.Text = Dimes
            txtCents.Text = Cents
        End If
    End Sub
End Class

sample output:

IDF Change Amount of change: 93 Determine Composition of Change Quarters: 3 Dimes: 1 Nickels: 1 Centes: 3

Add a comment
Know the answer?
Add Answer to:
An Introduction to Programming Using Visual Basic Tenth Edition Chapter 3 Programming Project 3 What is...
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
  • An Introduction to Programming Using Visual Basic Tenth Edition Chapter 3 Programming Project 2 What is...

    An Introduction to Programming Using Visual Basic Tenth Edition Chapter 3 Programming Project 2 What is the solution to this project? one of the numbers in an input text box is change the type of Auto Repair Calculator X Customer: John Doe Hours of labor: 3.5 Cost of parts and supplies 84.55 Display Bill + First number 21 Second number 77 х Customer Labor cost Parts cost Total cost John Doe $122.50 $88.78 $211.28 21 x 77 = 1617 FIGURE...

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

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

  • C++ Write a program that helps a young student learn to make change. Use the random...

    C++ Write a program that helps a young student learn to make change. Use the random number generator to generate change amounts between1¢ and 99¢. Ask the user how many quarters, dimes, nickels and pennies they need to make that amount. Determine whether the coins specified by the user total the specified amount and give them feedback on their answer including whether they used the minimum or optimum number of coins to produce the amount. Sample output of a program...

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

  • Please use C# For this project, we will see what it's like to write a simple...

    Please use C# For this project, we will see what it's like to write a simple windows application program that we can perform easily in our heads. You'll find that writing programs is similar to explaining things to a 5-year-old. You are to make this program "user friendly". In other words, make sure valid data has been entered. You are to create a simple change program. The user enters the amount due and the amount tendered. You are to calculate...

  • C++ HW Question Your program will simulate a simple change maker for a vending machine. It...

    C++ HW Question Your program will simulate a simple change maker for a vending machine. It will start with a stock of coins and dollars. It will then repeatedly request the price for an item to be purchased or to quit. If given a price, it will accept nickels, dimes, quarters, one-dollar and five-dollar bills—deposited one at a time—in payment. When the user has deposited enough to cover the cost of the item, the program will calculate the coins to...

  • You will complete this program using Windows (the one that uses #include ). For this project,...

    You will complete this program using Windows (the one that uses #include ). For this project, we will see what it's like to write a simple windows application program that we can perform easily in our heads. You'll find that writing programs is similar to explaining things to a 5-year-old. You are to make this program "user friendly". In other words, make sure valid data has been entered. You are to create a simple change program. The user enters the...

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

  • in c code x Global Soccer 1.docx x Acceleration Due to 6 x M Inbox (5,949)...

    in c code x Global Soccer 1.docx x Acceleration Due to 6 x M Inbox (5,949) - joshfor x M Inbox (4,224) - joshuar X ® AC ads/ACFrOgA6UB 1k4Z1i1xGLNQ1Lntj510 lutEUaA..pdf ECE 175: Computer Programming for Engineering Applications Lab Assignment #2 (Thursday sessions) Relevant Programming Concepts: • Branch Structure • Loop Problem 1 (15 points): Develop a C program that asks a user to enter a total change amount in cents) and outputs the change using the fewest coins. The coin...

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