New Posts  All Forums:Forum Nav:

Visual Basic help

post #1 of 15
Thread Starter 
Is anyone familiar with Microsoft Visual Basics and strings? I am taking a Visual Basics course and really need some help as I'm having problems doing an assignment. It is an introduction course so it is some basic stuff that would probably be simple to you guys but I'm stuck on how to do something right now.
Edited by dezahp - 10/10/11 at 3:37pm
current rig
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k @ 4.53 1.32v asus p8p67 deluxe MSI R6970 Lightning G.Skill Ripjaws 8gb DDR3 - 1664 MHz 9-9-8-21 1T 
Hard DriveHard DriveCoolingOS
WD Caviar Black 1.5 TB SATA 3 Gb/s 7200 RPM SAMSUNG 830 Series MZ-7PC256B/WW 256GB SSD Noctua NH-D14 Windows 10 Pro x64 
MonitorPowerCaseAudio
Asus ML238H 23" 1920 x 1080 Corsair Enthusiast Series 850-Watt 80 Plus Bronze CM Haf X Creative Sound Blaster X-Fi Titanium HD 
  hide details  
Reply
current rig
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k @ 4.53 1.32v asus p8p67 deluxe MSI R6970 Lightning G.Skill Ripjaws 8gb DDR3 - 1664 MHz 9-9-8-21 1T 
Hard DriveHard DriveCoolingOS
WD Caviar Black 1.5 TB SATA 3 Gb/s 7200 RPM SAMSUNG 830 Series MZ-7PC256B/WW 256GB SSD Noctua NH-D14 Windows 10 Pro x64 
MonitorPowerCaseAudio
Asus ML238H 23" 1920 x 1080 Corsair Enthusiast Series 850-Watt 80 Plus Bronze CM Haf X Creative Sound Blaster X-Fi Titanium HD 
  hide details  
Reply
post #2 of 15
Show us what you need help with first, and someone will help you. We just won't do your homework for you.
Intellect v2
(9 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-6700K Processor ASUS ROG MAXIMUS VIII HERO LGA1151 DDR4 M.2 SAT... EVGA GTX 1080 SC ACX 3.0 Crucial Ballistix Sport 32GB DDR4 2400 MT/s (PC... 
CoolingKeyboardPowerCase
Noctua NH-D15 Das Keyboard 4 Professional (Brown) Corsair AX860 Fractal Design Define R5 
Mouse
MIONIX NAOS 7000 
  hide details  
Reply
Intellect v2
(9 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-6700K Processor ASUS ROG MAXIMUS VIII HERO LGA1151 DDR4 M.2 SAT... EVGA GTX 1080 SC ACX 3.0 Crucial Ballistix Sport 32GB DDR4 2400 MT/s (PC... 
CoolingKeyboardPowerCase
Noctua NH-D15 Das Keyboard 4 Professional (Brown) Corsair AX860 Fractal Design Define R5 
Mouse
MIONIX NAOS 7000 
  hide details  
Reply
post #3 of 15
Thread Starter 
I wasn't hoping for someone to do it for me. I was hoping that whoever was willing to help me would go on aim or in a vent server to help me more effectively. Once I get home from my classes today I will post some of it so you get an idea.
current rig
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k @ 4.53 1.32v asus p8p67 deluxe MSI R6970 Lightning G.Skill Ripjaws 8gb DDR3 - 1664 MHz 9-9-8-21 1T 
Hard DriveHard DriveCoolingOS
WD Caviar Black 1.5 TB SATA 3 Gb/s 7200 RPM SAMSUNG 830 Series MZ-7PC256B/WW 256GB SSD Noctua NH-D14 Windows 10 Pro x64 
MonitorPowerCaseAudio
Asus ML238H 23" 1920 x 1080 Corsair Enthusiast Series 850-Watt 80 Plus Bronze CM Haf X Creative Sound Blaster X-Fi Titanium HD 
  hide details  
Reply
current rig
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k @ 4.53 1.32v asus p8p67 deluxe MSI R6970 Lightning G.Skill Ripjaws 8gb DDR3 - 1664 MHz 9-9-8-21 1T 
Hard DriveHard DriveCoolingOS
WD Caviar Black 1.5 TB SATA 3 Gb/s 7200 RPM SAMSUNG 830 Series MZ-7PC256B/WW 256GB SSD Noctua NH-D14 Windows 10 Pro x64 
MonitorPowerCaseAudio
Asus ML238H 23" 1920 x 1080 Corsair Enthusiast Series 850-Watt 80 Plus Bronze CM Haf X Creative Sound Blaster X-Fi Titanium HD 
  hide details  
Reply
post #4 of 15
Thread Starter 
If someone would be willing to help...I would greatly appreciate it. Basically I have to create a monthly loan payment calculator with For Loop on Visual Basic. I think I've finally figured out how to do For Loop but for some reason can't get the arithmetic to work...if you have vent, ts3, or AIM that would be even better. I wouldn't even know where to start explaining on here
Edited by dezahp - 10/10/11 at 9:37pm
current rig
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k @ 4.53 1.32v asus p8p67 deluxe MSI R6970 Lightning G.Skill Ripjaws 8gb DDR3 - 1664 MHz 9-9-8-21 1T 
Hard DriveHard DriveCoolingOS
WD Caviar Black 1.5 TB SATA 3 Gb/s 7200 RPM SAMSUNG 830 Series MZ-7PC256B/WW 256GB SSD Noctua NH-D14 Windows 10 Pro x64 
MonitorPowerCaseAudio
Asus ML238H 23" 1920 x 1080 Corsair Enthusiast Series 850-Watt 80 Plus Bronze CM Haf X Creative Sound Blaster X-Fi Titanium HD 
  hide details  
Reply
current rig
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k @ 4.53 1.32v asus p8p67 deluxe MSI R6970 Lightning G.Skill Ripjaws 8gb DDR3 - 1664 MHz 9-9-8-21 1T 
Hard DriveHard DriveCoolingOS
WD Caviar Black 1.5 TB SATA 3 Gb/s 7200 RPM SAMSUNG 830 Series MZ-7PC256B/WW 256GB SSD Noctua NH-D14 Windows 10 Pro x64 
MonitorPowerCaseAudio
Asus ML238H 23" 1920 x 1080 Corsair Enthusiast Series 850-Watt 80 Plus Bronze CM Haf X Creative Sound Blaster X-Fi Titanium HD 
  hide details  
Reply
post #5 of 15
I can't get into vent or anything tonight (because I'm actually programming, ironically). But if you show me the code you have so far, I can walk you through the problem(s).
Intellect v2
(9 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-6700K Processor ASUS ROG MAXIMUS VIII HERO LGA1151 DDR4 M.2 SAT... EVGA GTX 1080 SC ACX 3.0 Crucial Ballistix Sport 32GB DDR4 2400 MT/s (PC... 
CoolingKeyboardPowerCase
Noctua NH-D15 Das Keyboard 4 Professional (Brown) Corsair AX860 Fractal Design Define R5 
Mouse
MIONIX NAOS 7000 
  hide details  
Reply
Intellect v2
(9 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-6700K Processor ASUS ROG MAXIMUS VIII HERO LGA1151 DDR4 M.2 SAT... EVGA GTX 1080 SC ACX 3.0 Crucial Ballistix Sport 32GB DDR4 2400 MT/s (PC... 
CoolingKeyboardPowerCase
Noctua NH-D15 Das Keyboard 4 Professional (Brown) Corsair AX860 Fractal Design Define R5 
Mouse
MIONIX NAOS 7000 
  hide details  
Reply
post #6 of 15
I wont do it for you (as that defeats the purpose of taking the class) but I can definitely help you. PM me if you need any help.
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k ASRock P67 Extreme 4 MSI Cyclone GTX 460 SLI Corsair Vengeance 16GB 
Hard DriveOSMonitorKeyboard
OCZ Solid 3 SSD Windows 7 Professional (x64) Three Dell U2312HM Microsoft Sidewinder x4 
PowerCaseMouse
Corsair TX850 Lian-Li PC-K57 Razor Deathadder Black Edition 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k ASRock P67 Extreme 4 MSI Cyclone GTX 460 SLI Corsair Vengeance 16GB 
Hard DriveOSMonitorKeyboard
OCZ Solid 3 SSD Windows 7 Professional (x64) Three Dell U2312HM Microsoft Sidewinder x4 
PowerCaseMouse
Corsair TX850 Lian-Li PC-K57 Razor Deathadder Black Edition 
  hide details  
Reply
post #7 of 15
Thread Starter 
Ok well I'm going to post s/s so you can see my work. I'm very new to this so my code will be far from excellent. As I said before, I got the loop to work but I am not sure how to get my arithmetic right...I believe I have a value that is wrong somewhere or placed in the wrong spot but can't figure it out. I think one of them has to deal with the principle amount because the value should start off at 160,000 and be decreasing but that is not the case.



Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Loan, Interest, Years As Single
Dim Numberpayments, Monthlyrate, Monthlypayment As Single
Dim Interestpart, Principlepart, Balance, Principle As Single
Dim Paymentoutput As String
Loan = Val(TextBox1.Text)
Interest = Val(TextBox2.Text)
Years = Val(TextBox3.Text)
Dim count As Single
Numberpayments = Years * 12
Monthlyrate = 1 + (Interest / (12 * 100))
Monthlypayment = (Loan * Interest * Monthlyrate ^ Numberpayments) / (1200 * ((Monthlyrate ^ Numberpayments) - 1))
Interestpart = Principle * (Interest * 0.01) / 12
Principlepart = Monthlypayment - Interestpart
Principle = Loan - Principlepart
Balance = Principle - Principlepart
For count = 1 To Numberpayments
Paymentoutput = Paymentoutput & "Payment #" & count & vbTab & _
Format(Principle, "C") & " " & vbTab & FormatCurrency(Interestpart) & vbTab & _
FormatCurrency(Principlepart) & vbTab & FormatCurrency(Balance) & vbCrLf
Next count
TextBox4.AppendText("Payment Period" & vbTab & "Current Principle" & vbTab & "Interest" & vbTab & "Principle" & vbTab & vbTab & "Balance" & vbNewLine & Paymentoutput)
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = Nothing
TextBox2.Text = Nothing
TextBox3.Text = Nothing
TextBox4.Text = Nothing
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
End
End Sub
End Class
current rig
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k @ 4.53 1.32v asus p8p67 deluxe MSI R6970 Lightning G.Skill Ripjaws 8gb DDR3 - 1664 MHz 9-9-8-21 1T 
Hard DriveHard DriveCoolingOS
WD Caviar Black 1.5 TB SATA 3 Gb/s 7200 RPM SAMSUNG 830 Series MZ-7PC256B/WW 256GB SSD Noctua NH-D14 Windows 10 Pro x64 
MonitorPowerCaseAudio
Asus ML238H 23" 1920 x 1080 Corsair Enthusiast Series 850-Watt 80 Plus Bronze CM Haf X Creative Sound Blaster X-Fi Titanium HD 
  hide details  
Reply
current rig
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k @ 4.53 1.32v asus p8p67 deluxe MSI R6970 Lightning G.Skill Ripjaws 8gb DDR3 - 1664 MHz 9-9-8-21 1T 
Hard DriveHard DriveCoolingOS
WD Caviar Black 1.5 TB SATA 3 Gb/s 7200 RPM SAMSUNG 830 Series MZ-7PC256B/WW 256GB SSD Noctua NH-D14 Windows 10 Pro x64 
MonitorPowerCaseAudio
Asus ML238H 23" 1920 x 1080 Corsair Enthusiast Series 850-Watt 80 Plus Bronze CM Haf X Creative Sound Blaster X-Fi Titanium HD 
  hide details  
Reply
post #8 of 15
Thread Starter 
These are the details for the assignment.

This assignment will allow a user to enter:

Enter the amount of a loan (known as the principle, money to be borrowed)
An interest rate of the loan (i.e. 8, 9.5, 10.25, or 11.4)
Number of years for this loan (i.e. 5, 10, 15, 30)
Compute the monthly payment of a loan and determine the interest and principle portions for this month's payment

We will need a series of intermediate calculations:

Total Number of Payments = Number of years X 12
monthlyrate = 1 + (interest / (12 * 100))
monthlypayment = (Loan * interest * monthlyrate ^ Numberpayments) / (1200 * ((monthlyrate ^ Numberpayments) - 1)

The number of payment periods runs from 1 to 360. Each payment consists of interest on the balance of the loan and a principle repayment. The interest will decline, the principle portion increases. The falling interest portion is a smaller rate based on a smaller unpaid principle balance.

Within a For loop ( For count = 1 To Numberpayments)

interestpart = principle * (interest * 0.01) / 12

principlepart = monthlypayment - interestpart

balance = principle - principlepart


The Payment Period, the current principle, interestpart, principlepart and the balance should be printed.


The output is stored in a string:

paymentoutput = paymentoutput & "Payment #" & count & vbTab & _

Format(principle, "C") & " " & vbTab & FormatCurrency(interestpart) & vbTab & _ FormatCurrency(principlepart) & vbTab & FormatCurrency(balance) & vbCrLf


The current principle becomes the balance (principle = balance)
Edited by dezahp - 10/10/11 at 10:33pm
current rig
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k @ 4.53 1.32v asus p8p67 deluxe MSI R6970 Lightning G.Skill Ripjaws 8gb DDR3 - 1664 MHz 9-9-8-21 1T 
Hard DriveHard DriveCoolingOS
WD Caviar Black 1.5 TB SATA 3 Gb/s 7200 RPM SAMSUNG 830 Series MZ-7PC256B/WW 256GB SSD Noctua NH-D14 Windows 10 Pro x64 
MonitorPowerCaseAudio
Asus ML238H 23" 1920 x 1080 Corsair Enthusiast Series 850-Watt 80 Plus Bronze CM Haf X Creative Sound Blaster X-Fi Titanium HD 
  hide details  
Reply
current rig
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k @ 4.53 1.32v asus p8p67 deluxe MSI R6970 Lightning G.Skill Ripjaws 8gb DDR3 - 1664 MHz 9-9-8-21 1T 
Hard DriveHard DriveCoolingOS
WD Caviar Black 1.5 TB SATA 3 Gb/s 7200 RPM SAMSUNG 830 Series MZ-7PC256B/WW 256GB SSD Noctua NH-D14 Windows 10 Pro x64 
MonitorPowerCaseAudio
Asus ML238H 23" 1920 x 1080 Corsair Enthusiast Series 850-Watt 80 Plus Bronze CM Haf X Creative Sound Blaster X-Fi Titanium HD 
  hide details  
Reply
post #9 of 15
Thread Starter 
I forgot to add part so the 4th column is not principle. It is principle part. I am starting to get really frustrated
current rig
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k @ 4.53 1.32v asus p8p67 deluxe MSI R6970 Lightning G.Skill Ripjaws 8gb DDR3 - 1664 MHz 9-9-8-21 1T 
Hard DriveHard DriveCoolingOS
WD Caviar Black 1.5 TB SATA 3 Gb/s 7200 RPM SAMSUNG 830 Series MZ-7PC256B/WW 256GB SSD Noctua NH-D14 Windows 10 Pro x64 
MonitorPowerCaseAudio
Asus ML238H 23" 1920 x 1080 Corsair Enthusiast Series 850-Watt 80 Plus Bronze CM Haf X Creative Sound Blaster X-Fi Titanium HD 
  hide details  
Reply
current rig
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k @ 4.53 1.32v asus p8p67 deluxe MSI R6970 Lightning G.Skill Ripjaws 8gb DDR3 - 1664 MHz 9-9-8-21 1T 
Hard DriveHard DriveCoolingOS
WD Caviar Black 1.5 TB SATA 3 Gb/s 7200 RPM SAMSUNG 830 Series MZ-7PC256B/WW 256GB SSD Noctua NH-D14 Windows 10 Pro x64 
MonitorPowerCaseAudio
Asus ML238H 23" 1920 x 1080 Corsair Enthusiast Series 850-Watt 80 Plus Bronze CM Haf X Creative Sound Blaster X-Fi Titanium HD 
  hide details  
Reply
post #10 of 15
Thread Starter 
I think I solved one of the errors I have so now I finally get interestpart. Changed the code to....

Monthlypayment = (Loan * Interest * Monthlyrate ^ Numberpayments) / (1200 * ((Monthlyrate ^ Numberpayments) - 1))
Principle = Loan - Principlepart
Interestpart = Principle * (Interest * 0.01) / 12
Principlepart = Monthlypayment - Interestpart
Balance = Principle - Principlepart

Basically I changed principle so that it's before interestpart. I'm not sure how to get my arithmetic to work in the loop to that it continues to keep calculating the monthly payments...
Edited by dezahp - 10/10/11 at 11:01pm
current rig
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k @ 4.53 1.32v asus p8p67 deluxe MSI R6970 Lightning G.Skill Ripjaws 8gb DDR3 - 1664 MHz 9-9-8-21 1T 
Hard DriveHard DriveCoolingOS
WD Caviar Black 1.5 TB SATA 3 Gb/s 7200 RPM SAMSUNG 830 Series MZ-7PC256B/WW 256GB SSD Noctua NH-D14 Windows 10 Pro x64 
MonitorPowerCaseAudio
Asus ML238H 23" 1920 x 1080 Corsair Enthusiast Series 850-Watt 80 Plus Bronze CM Haf X Creative Sound Blaster X-Fi Titanium HD 
  hide details  
Reply
current rig
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600k @ 4.53 1.32v asus p8p67 deluxe MSI R6970 Lightning G.Skill Ripjaws 8gb DDR3 - 1664 MHz 9-9-8-21 1T 
Hard DriveHard DriveCoolingOS
WD Caviar Black 1.5 TB SATA 3 Gb/s 7200 RPM SAMSUNG 830 Series MZ-7PC256B/WW 256GB SSD Noctua NH-D14 Windows 10 Pro x64 
MonitorPowerCaseAudio
Asus ML238H 23" 1920 x 1080 Corsair Enthusiast Series 850-Watt 80 Plus Bronze CM Haf X Creative Sound Blaster X-Fi Titanium HD 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming