Question

In: Computer Science

1. What is the difference between Write and WriteLine in Visual Basic? 2. Can there be...

1. What is the difference between Write and WriteLine in Visual Basic?


2. Can there be more than one variable in a Write or WriteLine? Do they have to be all variables of the same type? Show it by modifying your program. Submit the modified and duly documented program in Visual Basic.


3. Explain the possible assignments of values to numerical variables of different primitive types: integer assigned to integer, integer assigned to real, real assigned to integer and real assigned to real. Which assignments are possible and which give an error in Visual Basic?

Solutions

Expert Solution

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Question 1:

  • Write() method will , print the specified string on the console without appending newline character at the end of the line.
  • While WriteLine() character will print the specified string on the console with appending newline character end of the string.
  • This means next string will print to the new line.

************************

Question 2:

  • Write() and WriteLine() method can be used to print more than one variable on the console.
  • Variables types can be different like String , Integer etc.
  • Example for Write() method

Dim firstName As String = "Virat"
Dim age As Integer = 31
Console.Write(firstName & " is " & age & " years old!")

Output :

Example for WriteLine() method :

Dim firstName As String = "Virat"
Dim age As Integer = 31
Console.WriteLine(firstName & " is " & age & " years old!")

Output :

************************

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.


Related Solutions

1.- Explain what a class is in Visual Basic. 2.- Explain what a method is in...
1.- Explain what a class is in Visual Basic. 2.- Explain what a method is in Visual Basic. 3.- What is the average formula? 4.- What is the variance formula? 5.- What is the standard deviation formula?
1. What are the three basic manufacturing cost categories? 2. What are the main difference between...
1. What are the three basic manufacturing cost categories? 2. What are the main difference between product costs and period costs? Give examples of each. 3. What is the difference between a fixed cost and a variable cost? Give examples of each. 4. What are differential costs? Opportunity costs? Sunk costs? Be specific and give examples of each. Please review youre grammar before posting the question.
1. What are different basic and important constitutional concepts? 2. What is the difference between Intentional...
1. What are different basic and important constitutional concepts? 2. What is the difference between Intentional and Unintentional torts? elaborate with examples. 3. What is the difference between merger and share exchange? 4. What area of corporate business does the “William Act” address? What are the different rules it provides for the concerned business? 5. Write in detail the procedure of formation and dissolution of LLC. Business Law questions.
1. What is the basic difference between project and project management
1. What is the basic difference between project and project management
how can i convert this to work in visual basic ? what are the formulas for...
how can i convert this to work in visual basic ? what are the formulas for that? You must create a Windows Forms application as the Conversion project including a picture of money on your form.  Create a textbox for the user to entry a dollar amount. Determine the number of quarters, dimes, nickels, and pennies using label controls to display the results.  In your calculation, you should use constant variables. ex) Enter dollar amount for conversion of 4.69 Number...
1. What is the difference between arguments, opinions and descriptions? 2. What is the difference between...
1. What is the difference between arguments, opinions and descriptions? 2. What is the difference between arguments and explanations, and what is the primary purpose of each?
Visual Basic Question : Sum = 1 + 1/2 + 1/3 + 1/4 + ....... A...
Visual Basic Question : Sum = 1 + 1/2 + 1/3 + 1/4 + ....... A project which allows the user to enter a number in the Textbox1 and which indicates the number of terms on the Label e.g. I enter 10 (sum) in the Textbox1 and Label1 indicates 12367 (terms) I have tried a few days but it does not work... thanks for your help! dim i, t as integer for i = 1 to t-1 textbox1 = textbox1...
I am trying to write code for a program in Visual Studo using Visual Basic programming...
I am trying to write code for a program in Visual Studo using Visual Basic programming language that computes the factorial of an entered number by using a For Loop. My problem is that it keeps re-setting the variable for Factorial. Below is my code if anyone can help. I want it to multiply the given number by that number - 1, then continuing to do so until it hits zero without multiplying by zero. Private Sub BtnCalculate_Click(sender As Object,...
1-What is the difference between Discontinued Operations and Extraordinary Items? 2-What is the difference between Deferred...
1-What is the difference between Discontinued Operations and Extraordinary Items? 2-What is the difference between Deferred Charges and Unearned Revenue? 3-Which of the following is not a stock market ratio? A. Earnings per share B. Book value C. Working capital investment D. Dividend Yield
create a Visual Basic project with the following features: 1. The user interface can display the...
create a Visual Basic project with the following features: 1. The user interface can display the following information, one textbox for one item: 1a. Author, in the form of Lastname, Firstname 1b. Title 1c. Source -- where the paper is published 1d. Abstract 1e. Publication year (This information is in the 1c. Source, but display the publication year separately here) 2. There is a command button "Import". It would allow the user to select the eric.txt as the input file...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT