0% found this document useful (0 votes)
2 views3 pages

Programming Constant

The document explains the concept of constants in programming, highlighting that they have fixed values and do not change. It includes programming tasks for calculating the area of a circle and a rectangle, as well as a code snippet for calculating a student's total marks and assigning a grade based on the total. The code also contains conditional statements to determine the student's grade based on their total marks.

Uploaded by

Stephanie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Programming Constant

The document explains the concept of constants in programming, highlighting that they have fixed values and do not change. It includes programming tasks for calculating the area of a circle and a rectangle, as well as a code snippet for calculating a student's total marks and assigning a grade based on the total. The code also contains conditional statements to determine the student's grade based on their total marks.

Uploaded by

Stephanie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

28/5/2022

Constant
 A constant is the opposite of a variable, it does
not change.
 A constant will be having a fixed value.
 Constants are still areas of memory that are
used to store data however they are used to
store data that will never change

Programming Task
Create a program that calculates the area of a
circle

Programming task 2
Create a program that calculates the area of a
rectangle
Programming Task 5
Dim StudentName As String
Dim StudentClass As String
Dim Paper1Mark As Integer
Dim Paper2Mark As Integer
Dim Total As Integer
Console.WriteLine("Enter student name")
StudentName = Console.ReadLine
Console.WriteLine("Enter class")
StudentClass = Console.ReadLine
Console.WriteLine("Enter mark for Paper 1")
Paper1Mark = Console.ReadLine
Console.WriteLine("Enter mark for Paper 2")
Paper2Mark = Console.ReadLine
Total = Paper1Mark + Paper2Mark
Console.WriteLine("The total is " & Total)
If Total > 90 < 99 Then
Console.WriteLine("The Student has a A")
ElseIf Total > 80 < 89 Then
Console.WriteLine("The Student has a B")
ElseIf Total > 70 < 79 Then
Console.WriteLine("The Student has a C")
ElseIf Total > 60 < 69 Then
Console.WriteLine("The Student has ")
If Total > 50 < 50 Then
Console.WriteLine("The Student has a D")
Else
Console.WriteLine("The Student has failed")
End If
Console.ReadKey()

You might also like