dim sack_content as string
dim sack_weight as decimal
dim cement as string = "c"
dim gravel as string = "g"
dim total_weight as decimal
dim order_number as integer
dim flag_reject as integer = 0
dim maxweight_sand_gravel as decimal = 50.1
dim minweight_sand_gravel as decimal = 49.1
dim minweight_cement as decimal = 24.9
dim maxweight_cement as decimal = 25.1
dim total_price as decimal
dim price_cement as decimal = 3
dim price_sand_gravel as decimal= 2
dim num_cement as integer
dim num_gravel as integer
console.WriteLine("Prices: 1 pack of cement = 3$, 1 pack of sand = 2$, 1 pack of gravel = 2$")
console.WriteLine("Special Pack: Buy 2 packs of sand + 2 packs of gravel + 1 pack of cement for 1$ off!")
console.WriteLine("Enter the number of sacks you want to order"): order_number = console.ReadLine()
Do while count <> order_number
console.writeline("Enter the sack's contents by inputing one of the following: c = cement, g = gravel, s = sand"): sack_content = console.ReadLine()
If sack_content = sand then
console.writeline("Enter the sack's weight. Range = 49.9kg - 50.1kg"): sack_weight = console.ReadLine()
If sack_weight < minweight_sand_gravel then
console.writeline("Sack of sand rejected - sack is underweight.")
flag_reject = flag_reject + 1
Elseif sack_weight > maxweight_sand_gravel then
console.writeline("Sack of sand rejected - sack is overweight.")
flag_reject = flag_reject + 1
console.writeline("Sack of sand accepted")
total_weight = sack_weight + total_weight
total_price = total_price + price_sand_gravel
elseif sack_content = gravel then
console.writeline("Enter the sack's weight. Range = 49.9kg - 50.1kg")
sack_weight = console.ReadLine()
If sack_weight < minweight_sand_gravel then
console.writeline("Sack of sand rejected - sack is underweight.")
flag_reject = flag_reject + 1
Elseif sack_weight > maxweight_sand_gravel then
console.writeline("Sack of gravel rejected - sack is overweight.")
flag_reject = flag_reject + 1
console.writeline("Sack of gravel accepted")
total_weight = sack_weight + total_weight
total_price = total_price + price_sand_gravel
num_gravel = num_gravel + 1
elseif sack_content = cement then
console.WriteLine("Enter the sack's weight. Range = 24.9kg - 25.1kg")
sack_weight = console.readline()
If sack_weight > maxweight_cement then
console.WriteLine("Sack of cement rejected - sack is overweight")
flag_reject = flag_reject + 1
elseif sack_weight < minweight_cement then
console.WriteLine("Sack of cement rejected - sack is underweight")
flag_reject = flag_reject + 1
console.Writeline("Sack of cement accepted")
total_weight = total_weight + sack_weight
total_price = total_price + price_cement
num_cement = num_cement + 1
console.writeline("Error. Unknown content. Please enter one of the following: c = cement, g = gravel, s = sand")
sack_content = console.ReadLine()
If num_cement = 1 and num_sand = 2 and num_gravel = 2
total_price = total_price - 1
console.WriteLine("Special pack has been bought and discount added to price.")
Console.Write("Total price of order = "): console.Write(total_price): console.writeline("$")
Console.Write("Total weight of order = "): console.Write(total_weight): console.Writeline("kg")
Console.write("Number of sacks rejected = "): console.writeline(flag_reject)