Question

In: Computer Science

In VB console write a Console Application that reads an input value for ??. You can...

In VB console write a Console Application that reads an input value for ??. You can assume that the user only inputs numeric values.

Solutions

Expert Solution

Compile & Execute Visual Basic Program

  • Start Visual Studio.
  • Specify a name and location.
  • Select -> File -> New -> Project(Ctrl+Shift+N) -> Console App(.Net Core) Visual Basic

Now, The new project appears in Solution Explorer.

Reads value from the user in Visual Basic Console App

Imports System 'Include the system namespace in our program.'

Module Program 'Module of a class that contains the data and procedures.'
Dim num1 As Integer 'Dim statement is used for variable declaration and storage allocation for one or more variables.'
Sub Main() 'Indicates the entry point'
num1 = Console.ReadLine() 'ReadLine for accepting input from the user and store it into a variable(num1).'

End Sub
End Module

Display input from to user in Visual Basic Console App

Imports System

Module Program
Dim num1 As Integer

Sub Main()
num1 = Console.ReadLine()

Console.WriteLine(num1) 'WriteLine is used to output the stream'

End Sub
End Module

* Dim num1 As Integer it only takes an Integer value as a input, If we try to pass an string it through an error => Conversion from string "String" to type 'Integer' is not valid.


Related Solutions

Write a Java console application that reads a string for a date in the U.S. format...
Write a Java console application that reads a string for a date in the U.S. format MM/DD/YYYY and displays it in the European format DD.MM.YYYY  For example, if the input is 02/08/2017, your program should output 08.02.2017
write a c# console application app that reads all the services in the task manager and...
write a c# console application app that reads all the services in the task manager and automatically saves what was read in a Notepad txt file.  Please make sure that this program runs, also add some comments
For input you can either a console Scanner or a dialog box (a modal dialog) and...
For input you can either a console Scanner or a dialog box (a modal dialog) and the static method showInputDialog() of the JOptionPane class which is within the javax.swing package like this String name= newJOptionPane.showInputDialog(” Please enter your data:”). Then convert the String object to a number using Integer.parseInt() or Double.parseDouble() ---- Write a java the ”Letter grade” program that inputs several test scores from user and displays for each the corresponding letter grade using a scale 90 – 80...
For input you can either a console Scanner or a dialog box (a modal dialog) and...
For input you can either a console Scanner or a dialog box (a modal dialog) and the static method showInputDialog() of the JOptionPane class which is within the javax.swing package like this String name= newJOptionPane.showInputDialog(” Please enter your data:”). Then convert the String object to a number using Integer.parseInt() or Double.parseDouble() --- Write a java ”Statistics program” to calculate the mean, variance and standard deviation for a given set of numbers. The user in entering the data interactively. The size...
For input you can either a console Scanner or a dialog box (a modal dialog) and...
For input you can either a console Scanner or a dialog box (a modal dialog) and the static method showInputDialog() of the JOptionPane class which is within the javax.swing package like this String name= newJOptionPane.showInputDialog(” Please enter your data:”). Then convert the String object to a number using Integer.parseInt() or Double.parseDouble() ----- . If an amount of A dollars is borrowed at an interest rate (expressed as a decimal) r for y years, and n is the number of annual...
For input you can either a console Scanner or a dialog box (a modal dialog) and...
For input you can either a console Scanner or a dialog box (a modal dialog) and the static method showInputDialog() of the JOptionPane class which is within the javax.swing package like this String name= newJOptionPane.showInputDialog(” Please enter your data:”). Then convert the String object to a number using Integer.parseInt() or Double.parseDouble() ----- Write a Java program to calculate the first n ( the user enters the integer n) rows of the Pascal triangle. On demand display the first n rows...
Java Input, Output and for-loop function. Practice01) Write-an average SCORE application called TestScores01 This project reads...
Java Input, Output and for-loop function. Practice01) Write-an average SCORE application called TestScores01 This project reads in a list of integers as SCOREs, one per line, until a sentinel value of -1. After user type in -1, the application should print out how many SCOREs are typed in, what is the max SCORE, the 2nd max SCORE, and the min SCORE, the average SCORE after removing the max and min SCORE. When SCORE >= 90, the school will give this...
Write a program that prints the question “Do you wish to continue?” and reads the input....
Write a program that prints the question “Do you wish to continue?” and reads the input. If the user input is “Y”, “Yes”, “YES”, then print out “Continuing”. If the user input is “N” or “No”, “NO” then print out “Quit”. Otherwise, print “Bad Input”. Use logical operators. c++
Write a java console application,. It simulates the vending machine and ask two questions. When you...
Write a java console application,. It simulates the vending machine and ask two questions. When you run your code, it will do following: Computer output: What item you want? User input: Soda If user input is Soda Computer output: How many cans do you want? User input:            3 Computer output: Please pay $3.00. END The vending machine has 3 items for sale: Soda the price is $1.50/can. Computer should ask “How many cans do you want?” Chips, the price is $1.20/bag....
String Input Console Application and Program Analysis Demonstrate an understanding of basic C++ programming concepts by...
String Input Console Application and Program Analysis Demonstrate an understanding of basic C++ programming concepts by completing the following: Program: Create a simple C++ console application that will write a program that will take string input from a user. Your program should reverse the string and then print the output to the screen. Take input from the user 3 times for varying string lengths. Program Analysis: Given your program implementation, discuss and identify the possible vulnerabilities that may exist. If...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT