Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(3) (2 marks) In Visual Studio, create and test a console application that does the following: (1) Create three variables of Integer data type, named
(3) (2 marks) In Visual Studio, create and test a console application that does the following: (1) Create three variables of Integer data type, named x, y, z respectively; (2) Use the built-in function Console.ReadLine() to get the user's input for x, y, z as follows I is assumed that the user alvays inputs integers when testing this program): Console.WriteLine("Input the first number:") I = CType(Console.ReadLine(). Integer) Console.WriteLine("Input the second number:") y=CType(Console.ReadLine(), Integer) Console.WriteLine("Input the third number:") z = CType(Console.ReadLine(), Integer) (3) Display the sum of the three numbers using the following statements: Console.WriteLine("The sum of the three numbers is) Console.WriteLine(x+y+z) (4) (4 marks) In Visual Studio, create and test a console application that does the following: (1) Create a variable of the Integer data type, named marks, (2) Create a variable of the String data type, named grade; (3) Use the built-in finction Console.ReadLine( to get the user's input for marks as follows t is assumed that the user always inputs integers when testing this program): Console.WriteLine("Input the marks:") marks = CType(Console.ReadLine(), Integer) (4) Convert marks into grade as follows using an If Then-Elself statement: marks grade 90-100 A+ 85-89 80-84 A- 77-79 B+ 73-76 B 70-72 B- 67-69 C+ 63-66 60-62 50-59 D 0-49 F (5) Display the value of grade in the console window using the following statement: Console.WriteLine("The grade is " & grade) Hint: The If-Then-Ekself statement is a lengthy one and is similar to the following: If ((marks >=90) And (marks =85) And (marks =0) And (marks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started