|
Console Application in Visual Studio 2005 as described below.
Create a module “Annuity calculator” that prompts the user and accepts
• the details of a loan amount, a positive integer (with no commas and currency symbols) say 100000 for $100,000,
• the rate of interest as a number, say 7 for 7%, and
• the term of the loan as an integer, like a 10 for a 10 year term.
Then the program computes and displays the annual installment due on this loan using the following formula,
a = (p * (1 + r) ^ n * r) / ((1 + r) ^ n - 1)
|
|
|
|
|
You have to do your own homework. Noone is going to do it for you.
If you've got a specific question about a problem with your code, great, ask away!
|
|
|
|
|
Module modAnnuityCalculator
Sub Main()
'Variable declaration
Dim rate, instalment As Double
Dim principal, term As Integer
' obtain user input to determine the instalment amount
Console.Write("Enter the required loan amount (with out commas) : $ ")
principal = Console.ReadLine
Console.Write("Enter the desired rate of interest (Eg: for 5% write 5) :")
rate = Console.ReadLine
Console.Write("Enter the loan term (in years) :")
term = Console.ReadLine
'calculates the annual instalment amount
instalment = (principal * ((1 + rate) ^ term * rate)) / (((1 + rate) ^ term) - 1)
Console.WriteLine("Instalment amount due per annum is : $ " & instalment)
Console.Read()
End Sub
End Module
I have written the above code but i am not getting the result. example... let the loan amount be 100000, rate 7.5 and period 20 but the result is not as calculated.
curious to know where is it going wrong ?
|
|
|
|
|
perhaps it is a fault with the rate, is the rate to be in the form of say 7% or 1.07.
|
|
|
|
|
ok my formula, and yours, had you typed it out more understandably are identical, the problem you are having arises from the fact that you need to divide rate by 100 before subbing it in, so instead of:
rate = console.readline
you need:
rate = console.readline/100
|
|
|
|
|
Dave Kreskowiak wrote: do your own homework. Noone is going to do it for you.
He could count on pmarfleet to do it for him, like his other homework problem.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
not gonna tell you how to do it, because it's obviously homework, but there is an alternative formula in the form of:
(p*(r^n)*(r-1))/((r^n)-1)
where r = ((annual rate)/100)+1
I daresay you need to use the given formula though.
You need to find out about working with integers and variables and what not, if you get stuck then ask us a specific question relating to your problem.
|
|
|
|
|
Two questions:
1. I want to allow a “user” to be able to change the text, backcolor, and forecolor of a ToolStripButton, ToolStripSplitButton. or a ToolStripTextbox. How do I allow the user to do this? The settings don’t persist when I close the application as they do when I drag a botton or textbox onto the form itself and then make changes to the control.
2. I want to use a property grid to display only the properties I have set up in Applications Settings for each control. How do I accomplish this? All the properties for the control show up on the property grid, not just the properties I’ve set up in the Application Settings.
I’m not a professional programmer. I do this for fun!! The examples I’ve seen don’t really explain much and some of them simply don’t work at all.
Thanks,
I’mRetired
kb4oxr@hotmail.com
Bruce
kb4zq@hotmail.com
|
|
|
|
|
You could always have some file to save the information, reload it when the user runs the form again...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
i have a number of child forms within a parent mdi
now i want access current child form from the mdi form.
i have created one prototype for the child form and then declared an array of forms in mdi's Load event and loaded them in a mdi menu's click event
|
|
|
|
|
Hi,
Dim CurrentChild As Form = Me.ActiveMDIChild
hope this helps
|
|
|
|
|
Hi,
thanks for ur help
but i have one more problem
i have 2 forms, frmtools and frmpad
i have created 10 instances of frmpad and loaded them on mdi's load event
now i want to do the required operations only if the CurrentChild is any of the instances of frmpad. if the CurrentChild is frmtools then nothing should happen
for that i have set the tag property of frmpad to "yes" and the tag property of frmtools to "no" and written the following:
if Me.ActiveMDIChild.tag = "yes" then dim a as frmpad = me.ActiveMDIChild
it works also.
but, i don't know the use of tag property. will there be any problems due to the change of tag property or there any other way to achieve this.
|
|
|
|
|
if u take mdi form then for child control u can take a contextmenustrip in tooltip. then the form .then u write the name. and double click and write
dim frm as new formname
frm.showdialog
this is the only coding
|
|
|
|
|
i can't understand u. will u be more descriptive
and one important thing is i am new to vb.net
|
|
|
|
|
I got this exception while i was deploying my Visual Basic.Net
project which reads as follows:
1)Could not copy temporary files to output directory
2)The file(file Name)cannot be copied to the run directory. The process cannot access the file because it is being used by another process.\
How do i solve this problem
|
|
|
|
|
Is your app still running from a previous launch?? Check in the Task Manager for you .EXE's name.
|
|
|
|
|
I want to display data in DataGrid according to groups (for eg.: Project Code -> Item Code -> Parts Detail). First display Project Code and then display Item Code which are comes under that project code(from next line) and then Items details for those items belongs to that Item Code.
Praveen
|
|
|
|
|
can anybody help me with:
set cursor and get cursor routines in VB.net
single click and double click routines in VB.net
regards.
FARAH
|
|
|
|
|
There isn't anyone on this earth who can answer this "question". Routines to do WHAT??
Are you looking to change the look of the mouse pointer?? Move the mouse pointer from your code?? Are you trying to handle the single-click of a control in your app?? Are you trying to send a "Click" to a control is your app?? Another app?? ...?? ...?? ...?? ...?? ...?? ...??
If you ask a question in less than 150 words, I guarantee you've left out details critical to answering your question correctly.
|
|
|
|
|
Dave Kreskowiak wrote: There isn't anyone on this earth who can answer this "question". Routines to do WHAT??
Dave Kreskowiak wrote: If you ask a question in less than 150 words, I guarantee you've left out details critical to answering your question correctly.
Excellent pearl of wisdom there
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Thank you! I'm thinking of making it part of my sig.
|
|
|
|
|
Why not? It sounds like a good one
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
If you right-click on a file in Windows Explorer, a menu pops out with functions like Copy To, Scan With etc.. How can i add my own option like Copy With <programname> and then, when the user clicks it, it opens my program with the name of the file in a variable. How can I accomplish this?
--Zaegra--
|
|
|
|
|
Search google or codeproject for Shell Extensions
Also you may use registry keys if you only want your program to handle some known types of files.
|
|
|
|
|
Hi everyone,
I was wondering how you all went about connecting to your databases from a security point of view. Some people say to use the SA password and embed security in your app with internal usernames/passwords, while others use Windows Security.
I think the SA password idea sounds simplier, and has the advantage of being able to limit what data the user gets to (eg: which clients information they can see) HOWEVER it doesn't stop someone using the password with MS Access to bypass your app and get the data.
So I was thinking the integrated security is best, and like any security, the use of groups would be best. My issue then becomes how to use those groups in SQL / VB.NET to enforce security, especially how would I enforce record level security (eg: which clients information they can see)
Thoughts everyone ??
|
|
|
|