Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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