Get up to 80 % extra points for free! More info:

Discussion: Solved tasks for Visual Basic .NET lessons 1-3

Back

 

Comments
Avatar
wasim
Member
Avatar
wasim:6/23/2019 20:37

I don't know it's the right way or not, can you please have a look at the first exercise.

Console.Write­Line("Hi, what is your name? ")
Dim input, output As String
input = Console.ReadLine()

Console.Write­Line("What are you like? ")
output = Console.ReadLine()
Console.Write­Line(input & " is " & output)

Console.ReadKey()
Thank you

 
Reply
6/23/2019 20:37
Avatar
wasim
Member
Avatar
wasim:6/23/2019 20:47

Intermediate exercise code
Console.Write­Line("Enter a number, and I'll square it: ")
Dim sqrt As Double
sqrt = Console.ReadLine()

Console.Write­Line("Result: " & sqrt ^ 2)
Console.ReadKey()
Please tell me doing right :-) Thank you

 
Reply
6/23/2019 20:47
Avatar
wasim
Member
Avatar
wasim:6/24/2019 0:00

The last one took me so long to figure it out, I am pretty sure it's the wrong code.

Console.Write­Line("Enter the circle's radius (cm):")
Dim c, r, pi As Double
pi = 3.142
c = 2 * 3.142 * r
r = Console.ReadLine()

Console.Write­Line("The circle's circumference based on the given radius is: " & 2 * 3.142 * r & " cm")
Console.Write­Line("Area of the circle is: " & r * r * pi & "cm2")
Console.ReadKey()
Thank you

Edited 6/24/2019 0:02
 
Reply
6/24/2019 0:00
Avatar
Replies to wasim
David Capka Hartinger:6/24/2019 5:23

Hi wasim,
all the 3 codes you posted are ok. The last result is a bit different than ours since you chose your pi to be 3.142 but it's not specified in the task description so you passed. Good job :)

Reply
6/24/2019 5:23
You can walk through a storm and feel the wind but you know you are not the wind.
Avatar
wasim
Member
Avatar
Replies to David Capka Hartinger
wasim:6/25/2019 18:14

Thank you, David.

 
Reply
6/25/2019 18:14
To maintain the quality of discussion, we only allow registered members to comment. Sign in. If you're new, Sign up, it's free.

5 messages from 5 displayed.