10 Computer program (BASIC) for calculation of
20 Predicted Mean Vote (PMV) and Predicted Percentage of Dissatisfied (PPD)
30 in accordance with International Standard, ISO 7730
40 CLS: PRINT "DATA ENTRY" data entry
50 INPUT " Clothing (clo) "; CLO
60 INPUT " Metabolic rate (met) " MET
70 INPUT " External work, normally around 0 (met) " WME
80 INPUT " Air temperature (°C) " TA
90 INPUT " Mean radiant temperature (°C) " TR
100 INPUT " Relative air velocity (m/s) " VEL
110 INPUT " ENTER EITHER RH OR WATER VAPOUR PRESSURE BUT NOT BOTH"
120 INPUT " Relative humidity (%) " RH
130 INPUT " Water vapour pressure (Pa) " PA
140 DEF FNPS (T) = EXP (16.6536-4030.183/T+235)) : saturated vapour pressure, kPa
150 IF PA = 0 THEN PA = RH * 10 * FNPS (TA) : water vapour pressure, Pa
160 ICL = .155 * CLO : thermal insulation of the clothing in m2K/W
170 M = MET * 58.15 : metabolic rate in W/m2
180 W = WME * 58.15 : external work in W/m2
190 MW = M – W : internal heat production in the human body
200 IF ICL u .078 THEN FCL = 1 + 1.29 * ICL
ELSE FCL = 1.05 + 0.645 * ICL : clothing area factor
210 HCF = 12.1 * SQR (VEL) : heat transf. coeff. by forced convection
220 TAA = TA + 273 : air temperature in Kelvin
230 TRA = TR + 273 : mean radiant temperature in Kelvin
240 -----CALCULATE SURFACE TEMPERATURE OF CLOTHING BY ITERATION ---
250 TCLA = TAA + (35.5-TA) / (3.5 * ICL + .1) : first guess for surface temperature
of clothing
260 P1 = ICL * FCL : calculation term
270 P2 = P1 * 3.96 : calculation term
280 P3 = P1 * 100 : calculation term
290 P4 = P1 * TAA : calculation term
300 P5 = 308.7 - .028 * MW + P2 * (TRA/100) * 4
310 XN = TLCA / 100
320 XF = XN
330 N = 0 : N: number of iterations
340 EPS = .00015 : stop criteria in iteration
350 XF = (XF + XN)/2
360 HCN =2.38 * ABS (100 * XF – TAA) ^ .25: heat transf. coeff. by natural convection
370 IF HCF>HCN THEN HC = HCF ELSE HC = HCN
380 XN = (P5 + P4 * HC – P2 * XF ^ 4) / (100 + P3 * HC)
390 N = N + 1
400 IF N > 150 THEN GOTO 550
410 IF ABS (XN – XF) > EPS GOTO 350
420 TCL = 100 * XN - 273 : surface temperature of the clothing
430 --------------------------------HEAT LOSS COMPONENTS -----------------------------------
440 HL1 = 3.05 * .001 (5733-6.99 * MW-PA) : heat loss diff. through skin
450 IF MW > 58.15 THEN HL2 = .42 * (MW – 58.15)
ELSE HL2 = 0! : heat loss by sweating (comfort)
460 HL3 = 1.7 * .00001 * m * (5867-PA) : latent respiration heat loss
470 HL4 = .0014 * m * (34 - TA) : dry respiration heat loss
480 HL5 = 3.96 * FCL * (XN^4 – (TRA/100^4) : heat loss by radiation
500 --------------------------------CALCULATE PMV AND PPD -----------------------------------
510 TS = .303 * EXP (- .036 * m) + .028 : thermal sensation trans coeff
520 PMV = TS * (MW – HL1 – HL2 – HL3 – HL4 – HL5 –HL6) : predicted mean vote
530 PPD = 100 – 95 * EXP (- .03353 * PMV ^ 4 - .2179 * PMV^ 2) : predicted percentage dissat.
540 GOTO 570
550 PMV = 999999!
560 PPD = 100
570 PRINT:PRINT "OUTPUT" : output
580 PRINT " Predicted Mean Vote (PMV): "
:PRINT USING "# # . #": PMV
590 PRINT " Predicted Percent of Dissatisfied (PPD): "
:PRINT USING "# # # . #": PPD
600 PRINT: INPUT "NEXT RUN (Y/N)"; RS
610 IF (RS = "Y" OR RS = "y") THEN RUN
620 END 

Visual basic (VB.net) Online Compiler

Write, Run & Share VB.net code online using OneCompiler's VB.net online compiler for free. It's one of the robust, feature-rich online compilers for VB.net language, running on the latest version 16. Getting started with the OneCompiler's VB.net compiler is simple and pretty fast. The editor shows sample boilerplate code when you choose language as VB.net. OneCompiler also has reference programs, where you can look for the sample code to get started with.

Read input from STDIN in VB.net

OneCompiler's VB.net online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample VB.net program which takes name as input and prints hello message with your name.

Public Module Program
	Public Sub Main(args() As string)
	 Dim name as String = Console.ReadLine()    ' Reading input from STDIN
   Console.WriteLine("Hello " & name)           ' Writing output to STDOUT
	End Sub
End Module

About VB.net

Visual Basic is a event driven programming language by Microsoft, first released in the year 1991.

Key Features

  • Beginner's friendly language.
  • Simple and object oriented programming language.
  • User friendly language and easy to develop GUI based applications.

Syntax help

Variables

Variable is a name given to the storage area in order to identify them in our programs.

Simple syntax of Variable declaration is as follows

Dim variableName [ As [ New ] dataType ] [ = initializer ]

Variable initialization

variableName = value

Conditional Statements

1. If

If condition-expression Then 
    'code
End If

2. If-else

If(conditional-expression)Then
   'code if the conditional-expression is true 
Else
  'code if the conditional-expression is false 
End If

3. If-else-if ladder

If(conditional-expression)Then
   'code if the above conditional-expression is true 
Else If(conditional-expression) Then
        'code if the above conditional-expression is true 
    Else
        'code if the above conditional-expression is false 
End If

4. Nested-If

If(conditional-expression)Then
   'code if the above conditional-expression is true
   If(conditional-expression)Then
         'code if the above conditional-expression is true 
   End If
End If

5. Select Case

Select [ Case ] expression
   [ Case expressionlist
      'code ]
   [ Case Else
      'code ]
End Select

Loops

1. For..Next

For counter [ As datatype ] = begin To end [ Step step ]
   'code
   [ Continue For ]
   'code
   [ Exit For ]
   'code
Next [ counter ]

2. For..Each

For Each element [ As datatype ] In group
   'code
   [ Continue For ]
   'code
   [ Exit For ]
   'code
Next [ element ]

3. While

While conditional-expression
   'Code 
   [ Continue While ]
   'Code
   [ Exit While ]
   'Code
End While

4. Do-while

Do { While | Until } conditional-expression
   'Code
   [ Continue Do ]
   'Code
   [ Exit Do ]
   'Code
Loop
Do
   'Code
   [ Continue Do ]
   'Code
   [ Exit Do ]
   'Code
Loop { While | Until } conditional-expression

Procedures

Procedure is a sub-routine which contains set of statements. Usually Procedures are written when multiple calls are required to same set of statements which increases re-usuability and modularity.

Procedures are of two types.

1. Functions

Functions return a value when they are called.

[accessModifiers] Function functionName [(parameterList)] As returnType
   'code
End Function

2. Sub-Procedures

Sub-procedures are similar to functions but they don't return any value.

Sub ProcedureName (parameterList)
'Code
End Sub