Results 1 to 11 of 11

Thread: Need help with calculator

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2017
    Posts
    9

    Exclamation Need help with calculator

    Hello!!

    First of all, I am not asking you guys to do my homework for me but i am stuck at arithmetics so I would appreciate any guidance.

    We are asked to design a rent calculator for Shoreline and Wavecrest communities. below are the specifications:

    - Shoreline adds $140
    - Fireplace adds $27
    - Smoking subtracts $11

    I wrote the code for these basic features but I am stuck on how to add fireplace to Shoreline price or subtract smoking. I can write a statement for each operation but our teacher wants the computer to do all the calculations. He says the fewer, the better.

    here's what i've got so far and I would appreciate any hints.
    Code:
        Private Sub btnRent_Click(sender As Object, e As EventArgs) Handles btnRent.Click
            If cboBuilding.Text = "Shoreline" Then
                lblDisplay.Text = txtBaseRent.Text + 140
            End If
    
            If chkFireplace.Checked = True Then
                lblDisplay.Text = txtBaseRent.Text + 27
            End If
    
            If chkNonSmoking.Checked = True Then
                lblDisplay.Text = txtBaseRent.Text - 11
            End If
    
        End Sub

    many thanks in advance!!!
    Last edited by Shaggy Hiker; Nov 18th, 2017 at 09:31 AM. Reason: Removed Italics in favor of CODE tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width