Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Visual Basic need help in detemining best option for creating code


  • Please log in to reply

#1
blue69

blue69

    New Member

  • Member
  • Pip
  • 1 posts

I have to determine the best way to code my VB program. I am creating a Apartment Property Mgt application. Where different selections by user feed into rent and deposit calculations. There are 3 different properties of which two have a premium tied to them which is a flat percentage of rent and all  options selected. For options some are standard and part of rent but other options increase the rent. There are options such as view, and # of bathrooms, Fireplace, non smoking, garage, extra parking space, extra storage, pets and an increase in deposit if you have bad credit.  I assume I should create contants for each of the options to store the value of the option

 

I know that I need to create code that will consider all options selected and then calculate both a rent and deposit

I have used a drop down list to select the property

I am using radio buttons for the bedrooms one, one plus den, or two bedroom.

he view (such as courtyard, pool, mountain view)

Bathrooms one, one and one half or two.

Pet selection DOG, CAT or NONE

 

In addition, I have some check boxes for extra's (fireplace, non smoking, extra parking, garage, storage, bad credit)

 

There is a default Base Rent value of 500.00 and then after all options are noted there is a calculate button they click and I return rent to a label and deposit to a second label.

 

I am not sure how best to create the code to produce the result I want without creating redundant code.I don't want to list in the code listing all the different buttons selected in order to calculate however the selection of the buttons does determine if the value of the rent is increased Any suggestions 


  • 0

Advertisements


#2
DevSquare

DevSquare

    Member

  • Member
  • PipPip
  • 34 posts

Hey there,

 

Looking at what you're trying to code there is possible in VB but have you considered a Microsoft Access Database. This has abilities to make drop down boxes and to make set values for new entries eg bedrooms or views. With the return label that is also possible with reports that can you can generate.

 

What is your proficiency in code?

 

Would it be worth coding something at that level or making a database for just general use.

 

Thanks from your Geeks :)


  • 0

#3
ident

ident

    Member

  • Member
  • PipPipPip
  • 745 posts

Hello and welcome to GeeksToGo :yeah:
 

Just to get a better understanding can you confirm is this for homework first please.


  • 0

#4
Veitch

Veitch

    Member

  • Member
  • Pip
  • 6 posts

I am not a VB programmer. But maybe you have a way to store the options with their values (increases to rent etc) attached easily as map, or alternatively as a properties file.

In pseudocode something like this with the tuples indicating (rent increase, percentage increase):

pet_map = {dog -> (2, 0), cat -> (2, 0), none -> (0,0)}
bathroom_map = {one -> (5,0), oneandhalf -> (10,0), two -> (20,0)}
rent = BASIS + pet_map(userpetoption).1 + bathroom_map(userbathoption).1

Just to get the idea.


Edited by Veitch, 25 July 2014 - 09:19 AM.

  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP