Visual Basic Programming and Pseudocode
Objective of this project is to develop the following applications:
Calculating sales tax on a sale
Converting from Fahrenheit to Celsius
Calculate a total bulk sales using number of units and price per units.
Calculating sales tax on a sale
This paper presents an application to calculate a sale tax. The sale tax rate is 6.48% based on the current rate in the United States.
Pseudocode
Output: Sales tax
Input: annual sale
Percentage of tax
Algorithms
enter the annual sales enter the sales tax rate
Calculate sale tax by multiplying total sales by tax rate (sale *6.48%)
Display sale tax on a sale
Program Interface
Code
Public Class Form1
Private Sub-Label1_Click (sender As Object, e As EventArgs) Handles Label1.Click
' calculate sale tax of a sale ' assign variable
Dim intSale As Integer
Dim intTax As Integer
' assign input to variables
Integer.TryParse (txtSale.Text, intSale)
Integer.TryParse (txtTax.Text, intTax)
'display tax rate
Const dbTax As Double = 0.0648
' calculate sale tax intTax = intTax * interSale
End Sub
Converting Fahrenheit to Celsius
This section develops an application that converts Fahrenheit to Celsius. The formula used to convert Fahrenheit to Celsius is:
Celsius= (Fahrenheit-30)/2
Algorithms
Output: Celsius
Input: Fahrenheit
Conversion Formula
Algorithms
1. enter the temperature in Fahrenheit
2. enter the conversion formula
3. Convert Fahrenheit to Celsius by using this formula Celsius= (Fahrenheit=30)/2
4. Display Celsius
Program Interface
Code
Public Class Form1
Private Sub-Label1_Click (sender As Object, e As EventArgs) Handles Label1.Click
' convert Fahrenheit to Celsius
' declare variables
Dim intFahrenheit As Integer
Dim intCelsius As Integer
'assign input to variables
Integer.TryParse (txtFahrenheit.Text, intFahrenheit)
Integer.TryParse (txtCelsius.Text, intCelsius)
' Convert
intCelsius = (Fahrenheit - 30) / 2
End Sub
Total bulk sale price using Number of Units and Price Per Unit
This application calculates the total bulk sales using number of units and price per units. All the sales prices are displayed in dollars.
Algorithm
Output: Bulk Sale Price
Input: Price Per Unit
Number of Units
Algorithms
1. enter the number of units
2. enter the price per unit
You’re 80% through this paper. Sign up to read the full paper.
Sign Up Now — Instant Access Already a member? Log inAlways verify citation format against your institution’s current style guide requirements.