Question

In: Computer Science

Objective: Only attempt this assignment after thoroughly reading Chapter 4 of the Visual Basic text. The...

Objective: Only attempt this assignment after thoroughly reading Chapter 4 of the Visual Basic text. The objective of the assignment is to write a program in Visual Basic that applies decision logic within the program. Another objective is to work through any syntax errors encountered (debugging) to develop a correct solution that is free of errors.

Description: Create a working Visual Basic solution using the Visual Studio IDE that accepts two numbers from the user and displays one of the following messages: First is larger, Second is larger, Numbers are equal. Provided your logic from last week was correct, you can use the pseudocode and flowchart from last's week's assignment to help you code your solution. After you output one of the three messages, calculate the average of the 2 numbers and display it for the user.

Requirements: For full credit, make sure that you create your program using Visual Studio. Also make sure that the program compiles (builds) successfully and without any errors. To test the logic of your program, make sure to try many different combinations of numbers. Ensure that in addition to displaying one of the three messages to the user that you also calculate and display the average as described.

Solutions

Expert Solution

This a a program in Visual Basic, it runs and compiles succesfully.

Imports System

Module operators
   Sub Main()
      Dim a As Double 
      Dim b As Double
      a=Console.ReadLine()
      b=Console.ReadLine()
      Dim avg As Double= (a+b)/2
      If (a = b) Then
         Console.WriteLine("Numbers are equal")
      Else If (a>b)
         Console.WriteLine("First is larger")
      Else
         Console.WriteLine("Second is larger")
      End If
      Console.WriteLine("Average is {0}",avg)
   End Sub
End Module

Here's the output for Input 12 and 9 respectively.


Related Solutions

After reading Chapter 3 of the text and watching the tutorial videos below, craft an initial...
After reading Chapter 3 of the text and watching the tutorial videos below, craft an initial post that answers the following questions: What are the possible reasons why the government may make a market intervention? What are the possible implications of such interventions? How might the wedge between consumers and firms lead to market distortions?
Objective: The objective of this assignment is to allow students to understand the basic principles of...
Objective: The objective of this assignment is to allow students to understand the basic principles of arrays Program Requirements: The assignment will require the students use arrays to perform mathematical calculations. Program Setup: Functions to include in the program The program will have three functions Function 1: Responsible for setting values in the arrays Function 2: Responsible for printing values in arrays Function 3: Responsible for doing calculations to arrays Function 1 Details: Setting array values Parameters: 3 Array of...
After reading about eating disorders in chapter 10 in your text, find a current article on...
After reading about eating disorders in chapter 10 in your text, find a current article on eating disorders and summarize the information presented in the article.  Compare the information from the article with the information in your text. (200 words)
Drugs Affects on the Brain Writing Assignment Directions and Rubric After reading chapter 3 in your...
Drugs Affects on the Brain Writing Assignment Directions and Rubric After reading chapter 3 in your text "PSYCHOLOGY ELEVENTH EDITION ", write a one page analysis of the interactions of each of the three types of psychoactive drugs (depressants, stimulants, hallucinogens) and the effects they have on the brain and nervous system.  Be sure to use specific examples in your analysis. The finished product should be one page in length double spaced with 12 point font and margins of 1 inch.
Please note: This is in Visual Basic. Create an application. Add a text box, a label,...
Please note: This is in Visual Basic. Create an application. Add a text box, a label, and a button to the form. If the user enters a number that is greater than 100 in the text box, the button's "click" event procedure should display the result of multiplying the number by 5. Otherwise, it should display the result of dividing the number by 5. Code the procedure.
Assignment-Vocabulary Review Use the information provided in Kinn's Chapter 4 "Healthcare Laws" of the text and/or...
Assignment-Vocabulary Review Use the information provided in Kinn's Chapter 4 "Healthcare Laws" of the text and/or any other sources you have. Copy and Paste your assignment on a separate MS word document or compatible file, and submit your completed assignment electronically via Moodle prior to due date. Please highlight your answers. Health Insurance Portability and Accountability Act 1. The _______________________ enforces HIPAA. 2. Describe the following components of HIPAA. a. Standard 1 related to transactions and code sets: ______________________________________________ b....
Assignment-Multiple Choice Use the information provided in Kinn's Chapter 4 "Healthcare Laws" of the text and/or...
Assignment-Multiple Choice Use the information provided in Kinn's Chapter 4 "Healthcare Laws" of the text and/or any other sources you have. Copy and Paste your assignment on a separate MS word document or compatible file, and submit your completed assignment electronically via Moodle prior to due date. Please highlight your answers. Circle the correct answer. 1. Which state law provides legal protection for those assisting an injured person during an emergency? a. Uniform Anatomical Gift Act b. Good Samaritan Act...
The objective of this homework assignment is to demonstrate proficiency with reading files, and using string...
The objective of this homework assignment is to demonstrate proficiency with reading files, and using string methods to slice strings, working with dictionaries and using-step wise development to complete your program. Python is an excellent tool for reading text files and parsing (i.e. filtering) the data. Your assignment is to write a Python program in four steps that reads a Linux authentication log file, identifies the user names used in failed password attempts and counts the times each user name...
Define Instructions: After reading Chapter 4 of the textbook, define the following terms: -System of linear...
Define Instructions: After reading Chapter 4 of the textbook, define the following terms: -System of linear equations -Solution to a system of equations -Consistent system of equations -Inconsistent system of equations Write a good paragraph with at least 5 sentences using a minimum of 75 words.
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT