CODE - For Next Loop - Program To Display The Most Active Year For Storms Between The Years 1990-2008
Sep 23, 2010
The program I am working on uses arrays and a text file. In one section of the program it's suppose to display the most active year for storms between the years 1990-2008. The year that has the most active storms is 2005, but I don't know how to write it in the code so that it displays. Attached is the text file.
So far I have a For Next loop that counts the arrays.
Public Class frmHurricanes
' Class Level Variables
Public Shared _intSizeOfArray As Integer = 18
[CODE]...
View 6 Replies
ADVERTISEMENT
Apr 15, 2012
I have a database of asset information with asset age as one of the columns..now i wish to display all the assets which crossed 4 years in the current year
View 8 Replies
May 26, 2011
<%
Dim i As Integer
Dim isNow = DatePart("yyyy", Now)
[code].....
View 1 Replies
Mar 26, 2011
I am working on a program that will display the number of storms in a specified year. This program uses a text file with years 1990-2010 and the number of storms for each year.
txt file:
Year 2010
6
Year 2009
3
Year 2008
8
Year 2007
15
Year 2006
10 .....
A user selects a year from a ComboBox (cboYear) and the program displays the number of storms using a label object (lblNumberOfStroms) for that year. The user then can click a button (btnDisplayStatistics) and the program will display using a label object, the number of storms for that year. This seems like a simple application but I am having trouble grasping the use of arrays concept.
View 1 Replies
Nov 6, 2009
I'm trying to use a combobox to pull the current year and then populate the next ten years. I don't want to manually put in the years in the 'item collections'. I would rather it update automatically based on the system year. How should I go about doing this?
My first instinct is to set the combobox item to the current year based on the system date, then create a loop that increments based on on counter up to current year + 10. I'm assuming this would be done on the 'form_load' event handler???
View 1 Replies
Feb 25, 2009
I am trying to write the following application. A project has initial investment, yearly revenue and yearly expenses. The program should be able to take these data and calculate the break-even year, i.e. when the cumulative profits become 0. Also, it should have a listbox that would list the cumulative profit for 10 years. Refer to the example below. Now I know how to show it in the listbox but I am having trouble showing the break-even year. I know how to calculate it but how do you show it in years.
View 8 Replies
Jul 25, 2010
I have a program where I have to calculate straight-line depreciation (cost * 1/n) n being the number of years to depreciate, and Double-Declining depreciation (cost * 2/n) using user input for year of purchase, cost, and years of depreciation. The output needs to be put into 4 columns in a list box. Year, Value at beginning of year, Amount of depreciation during the year and Total depreciation to the end of the year.
The problem I am having is with my loop. It is not properly calculating. I'm sure I am doing something wrong that is simple, but I can't see it.
Here is my code; the problem areas are bold:
Public Class frmDepreciation
Dim Cost, Life, Year, Depreciation, BegValue, EndValue, Total, Counter As Double
Dim fmtStr As String = "{0,-10}{1,10}{2,17}{3,5}{4,-15}"
Dim fmtStr2 As String = "{0,-10}{1,10}{2,17}{3,15}"
[CODE]....
View 3 Replies
Apr 9, 2012
I've seemed to found some interesting behavior with the stock MonthCalendar control. I've set the MinDate property to 1/1/1990 but when I try to actually select a date anywhere previous to 1/1/2000 it jumps to 12/31/2999 why is that?
I've tries manually setting it to 4/8/1998 and it jumps to 4/8/2998 which isn't what I would expect a calendar control to do. Is there a reason it keeps it within the 21st century?
View 5 Replies
Apr 20, 2011
Suppose $800 is deposited into a savings account earning 4% interest compounded annually, and $100 is added to the account at the end of each year. Calculate the amount of money in the account at the end of 10 years. Determine a formula for computing the balance at the end of one year based on the balance at the beginning of the year.Allow the user to input the beginning balance and the amount to be contributed at the end of each year. You must a loop in this program. [code] I cannot figure out how to make the previous years balance become the next years and so forth.
View 6 Replies
May 24, 2010
How do i set the active cell by code?
Lets say after cell(0,0) has been edited. On the cell Leave event it must set the active cell to be cell(0,4)
View 1 Replies
Aug 11, 2009
I assigned an integer as 1, and looped my program using:[code]I can recieve the packets without looping, but once i loop, i receive nothing.
View 29 Replies
Jan 20, 2009
I need to save actual age (in whole years) for future use in the program. The problem is, 'Years' returns a big, fat 0 every time. Changing "Dim years As Integer" to Dim years As String" does exactly the same thing.
Code:
Dim myDate = New Date(Convert.ToInt32(Year.Value), Month.SelectedIndex + 1, Convert.ToInt32(Day.Value))
'If Month, Day, or Year not selected then
[Code]....
View 5 Replies
Sep 18, 2009
How do you do the code setup for Hours and Years Slept Program
View 4 Replies
Nov 11, 2010
This command will show todays date:
Code:
MsgBox(DateTime.Now.ToShortDateString())
View 2 Replies
Jun 10, 2011
program that allows the user to enter a month and a number of years. (e.g March and 10 years) The program then displays all the months of the year from the entered month in a loop that runs as many times as the number of years.(e.g March April May.....December January February March....)
View 1 Replies
Nov 30, 2009
I'm writing a small app that finds the directory of an active program and displays it in a message box. e.g. Microsoft Word is open and running... click a button and the app finds the Microsoft Word's directory. It has to be able to differentiate between the active program and inactive copy of the program.
View 1 Replies
Jun 12, 2009
I am trying to display only year in datetimepicker in vb.net
View 6 Replies
Jun 4, 2009
Create a combo box that contains the values:
- Year 7
- Year 8
- Year 9
- Year 10
Thats easy enough, but i need to then need to do the following:When a option is selected, i want to display a seperate table for that year.For example, if i select "Year 7" a table specificly for "Year 7" is displayed.(Using visual studio)
View 11 Replies
May 30, 2010
I need to make a program for school that closes the active window. My application does now SendKeys.Send("%{F4}"). It works but, it also does it when there are no active windows. I want it to close only the active windows.
View 6 Replies
Dec 22, 2010
How do I get final output to display month, day, year? Would I need another replace array? Or can I dynamically format from SQL table?[code]...
View 7 Replies
Apr 17, 2012
How to set current year in AssemblyInfo file?
I used
Instead of this:
<Assembly: AssemblyCopyright("Copyright 2012, Company Name.")>
tried this:
<Assembly: AssemblyCopyright("Copyright" + DateTime.Now.Year.ToString() + ", Company Name.")>
I get invalid constant error.
I don't want to use registry key entries, what is the optimum way of doing this? (so that when a user right clicks on EXE & looks for assembly information can see current year).
View 3 Replies
Mar 26, 2012
I would like to loop through a number of integers to display the higher number, I would not know the higher or the lower number. How could I compare them to pick the higher one.
View 9 Replies
Dec 13, 2009
I'm using VS in Vista. I have using a DataBase in SQL2008 which its date format is year,month,day. In my app I have the date format as Format(Now, "d") which shows 13/12/2009 but when inserted it displays as 1900-01-01 in the DataBase. How can I have the date format to dispalay year,month,day as in the database.
View 10 Replies
Jun 10, 2009
I am having trouble with code for list box of Leap Years between a certain start date and end date.I understand the cose for finding out if a particular year is a leap year, but what I need to to is have all leap years show in a list box, once one has entered a start date (year) and an end date(year).
View 25 Replies
May 1, 2009
I have an internal application that I needs to have a drop down list for two date type elements: Month and Year.These values are not in a database or other repository of information.I know I could just setup a list with the values I need by adding them to a dictionary like object (I need to correlate the Month to the numerical representation, January => 01):
var months = new Dictionary<String,String>();
months.Add("01", "January");
...
The drop down list for the year will be a bit easier as I can just choose a starting year and iterate up to the current or current+1 year in a generic list.Is there a better way to handle these data elements? Something built in, or a good design pattern that I should be implementing?
View 4 Replies
Apr 21, 2009
Does automatic software update causes some of the module property not to work? They are basically the same function that reads image logo from the currently executing assembly. Function named "Get2LogoImageStream" is different from "Get1LogoImageStream" by just Current.ManifestModule.Name vs Current.ManifestModule.ScopeName.
This "Current.ManifestModule.Name " version of the code worked on both Web From app and Windows form app, however right now it only works for Windows App form. But when I changed this code "Current.ManifestModule.Name" with "Current.ManifestModule.ScopeName" and it worked on WEB without any problem. So my questions to fellow C# or VB.NET developers is that does automatic software update causes this kind of issues?
protected Stream Get1LogoImageStream()
{
Assembly current = Assembly.GetExecutingAssembly();
string imageName = "logo.jpg";
[code]....
View 4 Replies
Jul 29, 2009
im creating my own control to replace the Date Calender within 2008. I want to return a list of Years into a combobox for the user to select.
Im aware i can manually add these years but ideally i would like to return a list just like the calender control.
View 3 Replies
Jan 26, 2010
i want to insert booking_no as combination of year and sno(year/sno) into database here iam giving the code as follows,,,,,,,,,
here sno stated from 1.........
Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("guest1").ConnectionString())
Dim booking_no, sno As String
If Len(sno) = 1 Then
[code]....
but here booking_no was not inserted properly,it was inserted as "0/ ",,iwant to insert booking_no as "2010/sno" ,
View 2 Replies
Jun 12, 2011
how to validate the day if the selected year is a leap year in combo box.
View 1 Replies
Nov 15, 2011
I am trying to make a simple program to display a shipping charge based upon a selected zip code. Where can I find sample code that I can use as a guide? I can create the GUI but can't figure our the code.
View 2 Replies