C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter4: Control Structures I (selection)
Section: Chapter Questions
Problem 20PE: The cost of renting a room at a hotel is, say $100.00 per night. For special occasions, such as a...
icon
Related questions
Question

An Internet service provider has three different subscription packages for its customers: Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour. Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month unlimited access is provided. Write a program that calculates a customer’s monthly bill. It should ask the user to enter the letter of the package the customer has purchased (A, B, or C) and the number of hours that were used. It should then display the total charges.

Using Visual Basic I need help finishing this code this is what I got so far

Dim decpackageA As Decimal
Dim decpackageA1 As Decimal
Dim decpackageB As Decimal
Dim decpackageB1 As Decimal
Dim decpackageC As Decimal
Dim inthours_worked As Integer
Dim dectotal_chargespackageA As Decimal
Dim dectotal_chargespackageB As Decimal
Dim dectotal_chargespackageC As Decimal
Dim dbltotal_charges As Double


'Assign the textbox values to variables
decpackageA = inthours_worked < 10 = 9.95
decpackageA1 = inthours_worked > 10 = 9.95 * 2
decpackageB = inthours_worked < 20 = 14.95
decpackageB1 = inthours_worked > 20 = 14.95 * 1
decpackageC = inthours_worked > 0 = 19.95
dectotal_chargespackageA = decpackageA Or decpackageA1
dectotal_chargespackageB = decpackageB Or decpackageB1
dectotal_chargespackageC = decpackageC


TextBox3.Text = "$" + dbltotal_charges.ToString()
TextBox3.Text = "$" + decpackageA.ToString()
TextBox3.Text = "$" + decpackageB.ToString()
TextBox3.Text = "$" + decpackageC.ToString()
TextBox3.Text = "$" + dectotal_chargespackageA.ToString()
TextBox3.Text = "$" + dectotal_chargespackageB.ToString()
TextBox3.Text = "$" + dectotal_chargespackageC.ToString()

I keep getting 0 as the total charges where did I go wrong im using visual basic 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning