Question

In: Computer Science

Create programs in Visual Basic which perform each of the following: Explain the different design choices...

Create programs in Visual Basic which perform each of the following: Explain the different design choices (syntax) for option in each language Document the programs using Flowcharts Each programs source code must be included – label each with the language used

a) Nested two-way selection statements

b) Multiple-way selection statement

c) Iterative Statements – Counter controlled and Logic controlled

d) After the Counter Controlled Iterative successfully completes – Display “This was a success” on the screen.

Solutions

Expert Solution

a)

Module Module1

Sub Main()

Dim value = 200
If value < 1000 Then

If value < 500 Then
If value < 100 Then
Console.WriteLine("Value is less than 100")

Else
Console.WriteLine("Value is greater than 100")
End If

Else
Console.WriteLine("Value is greater than 500")

End If

Else

Console.WriteLine("Value is greater than 1000")
End If
  
Console.ReadLine()


End Sub

End Module

Output:

Value is greater than 100

b)

Module Module1

Sub Main()

Dim score As Char
score = "F"
Select Case score
Case "A"
Console.WriteLine("90-100!")
Case "B"
Console.WriteLine("80-90")
Case "C"
Console.WriteLine("70-80")
Case "D"
Console.WriteLine("60-70")
Case "F"
Console.WriteLine("50-60")
Case Else
Console.WriteLine("Invalid...")
End Select
Console.ReadLine()


End Sub

End Module

Output:

50-60

c)

Code:

Module Module1

Sub Main()

Dim value As Integer
' for loop execution
For value = 1 To 5 Step 1
Console.WriteLine("value of a: {0}", value)
Next
Console.ReadLine()


End Sub

End Module

Output

value of a: 1
value of a: 2
value of a: 3
value of a: 4
value of a: 5

d)

code:

Module Module1

Sub Main()

Dim value As Integer
' for loop execution
For value = 1 To 5 Step 1
Console.WriteLine("value of a: {0}", value)
Next

Console.WriteLine("This was success")
Console.ReadLine()


End Sub

End Module

value of a: 1
value of a: 2
value of a: 3
value of a: 4
value of a: 5
This was success

Flowcharts:


Related Solutions

Create programs in Visual Basic which perform each of the following: Explain the different design choices...
Create programs in Visual Basic which perform each of the following: Explain the different design choices (syntax) for option in each language Document the programs using Flowcharts Each programs source code must be included – label each with the language used a) Nested two-way selection statements b) Multiple-way selection statement c) Iterative Statements – Counter controlled and Logic controlled d) After the Counter Controlled Iterative successfully completes – Display “This was a success” on the screen.
In this project, you will create a Visual Basic solution to perform customer billing at the...
In this project, you will create a Visual Basic solution to perform customer billing at the Cyberian Internet Cafe. Please see below for the detailed instructions. You will create the project and then design a form using the image provided here. Then, add the necessary code to do the billing calculation and display the amount due. Instructions In this case, you will create a Visual Basic solution that performs customer billing for the Cyberian Internet Café. The Cyberian Internet Café...
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...
USE VISUAL BASIC / VB You will create a datafile with the following information: 70 80...
USE VISUAL BASIC / VB You will create a datafile with the following information: 70 80 90 55 25 62 45 34 76 105You will then write the program to read in the values from the datafile and as you read in each number, you will then evaluate it through an if statement for the weather of the day. For example, when you read in the value 70 from the datafile, you should print to the screen that the temperature...
Create a program (or set of programs) which accomplish the following for each complex data type...
Create a program (or set of programs) which accomplish the following for each complex data type (list,tuple,set,frozenset, dictionary): create the item with at least 4 elements Append an element Remove an element Insert an element in the middle somewhere Append another array of the same data type Append another array of a different data type (for example, if you have a dictionary, append a set or tuples And do the following: Output the results after each step. Report and explain...
Create a program (or set of programs) which accomplish the following for each complex data type...
Create a program (or set of programs) which accomplish the following for each complex data type (list,tuple,set,frozenset, dictionary): create the item with at least 4 elements Append an element Remove an element Insert an element in the middle somewhere Append another array of the same data type Append another array of a different data type (for example, if you have a dictionary, append a set or tuples And do the following: Output the results after each step. Report and explain...
For each of the following Visual Basic code snippets, identify the syntax error.   If intX >...
For each of the following Visual Basic code snippets, identify the syntax error.   If intX > 100   lblResult.Text = "Invalid Data" End If   Dim str As String = "Hello" Dim intLength As Integer intLength = Length(str) If intZ < 10 Then   lblResult.Text = "Invalid Data"   Dim str As String = "123" If str.IsNumeric Then   lblResult.Text = "It is a number." End If   Select Case intX   Case < 0     lblResult.Text = "Value too low."   Case > 100     lblResult.Text = "Value too high."   Case Else     lblResult.Text = "Value...
Use Visual Basic Language In this assignment,you will create the following data file in Notepad: 25...
Use Visual Basic Language In this assignment,you will create the following data file in Notepad: 25 5 1 7 10 21 34 67 29 30 You will call it assignment4.dat and save it in c:\data\lastname\assignment4\. Where lastname is your last name. The assignment will be a console application that will prompt the user for a number. Ex. Console.Write(“Enter a number: ”) And then read in the number Ex. Number = Console.ReadLine() You will then read the data file using a...
Use Visual Basic Language In this assignment you will need to create a program that will...
Use Visual Basic Language In this assignment you will need to create a program that will have both a “for statement” and an “if statement”. Your program will read 2 numbers from the input screen and it will determine which is the larger of the 2 numbers. It will do this 10 times. It will also keep track of both the largest and smallest numbers throughout the entire 10 times through the loop. An example of the program would be...
Description: To create a Visual Basic program that will obtain a sentence from the user, parse...
Description: To create a Visual Basic program that will obtain a sentence from the user, parse the sentence, and then display a sorted list of the words in the sentence with duplicate words removed. Tasks: Design a method (algorithm) to solve the above problem using pseudocode or a flowchart. Translate your algorithm into an appropriate VB program and test it using the following input sentence. "We are the world We are the children" Submit: Pseudocode version of algorithm/Flowchart version of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT