Question

Imagine your boss hands you a large bag. You are told it contains an unknown number of American currency notes (i.e. paper mo

What are the first few steps to solving this on Microsoft Visual Basis

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Module Module1

Sub Main()
Dim fileReader As System.IO.StreamReader
fileReader =
My.Computer.FileSystem.OpenTextFileReader("D:\\MoneyBag.txt")
Dim line As String
Dim n(500) As String
Dim count As Integer, i As Integer
count = 0
i = 0
line = fileReader.ReadLine()
While (line <> Nothing)
line = fileReader.ReadLine()
count = count + 1
n(i) = line
i = i + 1
End While
Dim intData() As Integer = {1, 2, 5, 10, 20, 50, 100}
Dim intVal(7) As Integer
For i = 0 To count
If n(i) = "1" Then
intVal(0) = intVal(0) + 1
ElseIf n(i) = "2" Then
intVal(1) = intVal(1) + 1
ElseIf n(i) = "5" Then
intVal(2) = intVal(2) + 1
ElseIf n(i) = "10" Then
intVal(3) = intVal(3) + 1
ElseIf n(i) = "20" Then
intVal(4) = intVal(4) + 1
ElseIf n(i) = "50" Then
intVal(5) = intVal(5) + 1
Else
intVal(6) = intVal(6) + 1
End If
Next i
Console.WriteLine("Denominations Count")
For i = 0 To 6
Console.Write(intData(i) & Space(15) & intVal(i))
Console.WriteLine()
Next

Console.Read()
End Sub

End Module

Add a comment
Know the answer?
Add Answer to:
What are the first few steps to solving this on Microsoft Visual Basis
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • JAVA Code: Complete the program that reads from a text file and counts the occurrence of...

    JAVA Code: Complete the program that reads from a text file and counts the occurrence of each letter of the English alphabet. The given code already opens a specified text file and reads in the text one line at a time to a temporary String. Your task is to go through that String and count the occurrence of the letters and then print out the final tally of each letter (i.e., how many 'a's?, how many 'b's?, etc.) You can...

  • Task 1 Draw a flowchart that presents the steps of the algorithm required to perform the...

    Task 1 Draw a flowchart that presents the steps of the algorithm required to perform the task specified. You can draw the flowcharts with a pen/pencil on a piece of paper and scan it for submission. Please ensure that the scanned file and your handwriting are clear and legible. However, it is preferable to draw flowcharts using a drawing software. Here are links to some free drawing tools https://www.draw.io/ www.lucidchart.com http://dia-installer.de/ https://pencil.evolus.vn/ ---------------------------------DON'T NEED THE PYTHON CODE... JUST THE ALGORITHM...

  • I need help building a program on microsoft visual studio using c++ language. implement a program...

    I need help building a program on microsoft visual studio using c++ language. implement a program called "charword_freq.cpp" to determine the number of words and the number of occurrences of each letter in a block of text stored in a data file called “mytext.dat”. Define a word to be any string of letters that is delimited at each end by either whitespace, a period, a comma, or the beginning or end of a line. You can assume that the input...

  • Background: The first step towards helping someone 'decode' a message is often to count how many...

    Background: The first step towards helping someone 'decode' a message is often to count how many times each letter of the alphabet appears in the message. Then divide each count by the total number of letters to compute the relative 'frequency'.   From these frequencies, it may be easier to recognize which letters are assigned to the vowels. For your own reference, here is a table of standard letter frequencies from typical English text. (You do NOT need to display this...

  • Task 1 Draw a flowchart that presents the steps of the algorithm required to perform the task spe...

    Task 1 Draw a flowchart that presents the steps of the algorithm required to perform the task specified. You can draw the flowcharts with a pen/pencil on a piece of paper and scan it for submission. Please ensure that the scanned file and your handwriting are clear and legible. However, it is preferable to draw flowcharts using a drawing software. Here are links to some free drawing tools https://www.draw.io/ www.lucidchart.com http://dia-installer.de/ https://pencil.evolus.vn/ ---------------------------------DON'T NEED THE PYTHON CODE... JUST THE ALGORITHM...

  • Project 2 Sorting, CPU Time, and Big O Analysis Note: you will be using Microsoft Visual...

    Project 2 Sorting, CPU Time, and Big O Analysis Note: you will be using Microsoft Visual Studios 2019 as the compiler. This is an individual assignment. You will have lab time to work on this assignment as well as homework time. Each person will analyze two sorts. The first sort will be either bubble sort or insertion sort. The second sort will be either quick sort or merge sort. Create two projects, one for each sort in the given choices....

  • Program in C++! Thank you in advance! Write a menu based program implementing the following functions: (1) Write a funct...

    Program in C++! Thank you in advance! Write a menu based program implementing the following functions: (1) Write a function that prompts the user for the name of a file to output as a text file that will hold a two dimensional array of the long double data type. Have the user specify the number of rows and the number of columns for the two dimensional array. Have the user enter the values for each row and column element in...

  • please help!!! this is VMware Workstation, thank you! Create a c program of your choosing that...

    please help!!! this is VMware Workstation, thank you! Create a c program of your choosing that follows the specifications below: • Define a struct with 4 or more members. The struct must be different from the ones used in class (20 points) Declare an array of your struct using a size of 10 or more (20 points) Load the data for each element in your array from a text file (20 points) Display the data in your array in the...

  • PYTHON CODING HELP: BELOW ARE THE STEPS I NEED HELP WITH PLEASE. :) First create a...

    PYTHON CODING HELP: BELOW ARE THE STEPS I NEED HELP WITH PLEASE. :) First create a text file named "items.txt" that has the following data in this order: Potatoes Tomatoes Carrots ... and have it be in the same directory as the Python program you are coding for this assignment. IMPORTANT: Your program should work with any size file. It should work with 100 items listed or with no items in the file! Write a Python program that ... 1....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT