Question

Programming in Visual Basic Create a telephone-number word generator and give it the ability to write...

Programming in Visual Basic

Create a telephone-number word generator and give it the ability to write to a file every possible seven-letter word combination corresponding to a telephone number.

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

Public Class FrmWordGenerator
Private Sub btnGenerate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerateWord.Click
If Not IsNumeric(txtPhoneNumber.Text) Then
txtPhoneNumber.Text = ""
Else
If txtPhoneNumber.Text.Length < 7 Then
MessageBox.Show("Phone Number Must Be 7 Digits Long")
Else
Dim phoneNumber As Integer = Convert.ToInt32(txtPhoneNumber.Text)
Dim letters(,) As String = {{" ", " ", " "},
{" ", " ", " "}, {"A", "B", "C"}, {"D", "E", "F"},
{"G", "H", "I"}, {"J", "K", "L"}, {"M", "N", "O"},
{"P", "R", "S"}, {"T", "U", "V"}, {"W", "X", "Y"}}
Dim digits(6) As Integer
Dim output As String = String.Empty
For i = 6 To 0 Step -1
digits(i) = phoneNumber Mod 10
phoneNumber \= 10
Next
For Loop1 = 0 To 2
For Loop2 = 0 To 2
For loop3 = 0 To 2
For loop4 = 0 To 2
For loop5 = 0 To 2
For loop6 = 0 To 2 For loop7 = 0 To 2
output &= String.Format("{0, -7}",
letters(digits(2), Loop1) &
letters(digits(3), Loop2) &
letters(digits(4), loop3) &
letters(digits(5), loop4) &
letters(digits(6), loop5) &
letters(digits(7), loop6) &
letters(digits(8), loop7))
Next loop7
Next loop6
Next loop5
Next loop4
Next loop3
Next Loop2
Next Loop1
txtOutput.Text = output
End If
End If
End Sub
End Class

Add a comment
Know the answer?
Add Answer to:
Programming in Visual Basic Create a telephone-number word generator and give it the ability to write...
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
  • Regular C Programming It is just a random generator of telephone numbers DESCRIPTION To make telephone...

    Regular C Programming It is just a random generator of telephone numbers DESCRIPTION To make telephone numbers easier to remember, some companies use letters to show their telephone number, but mapping the letters to the numbers on a standard telephone keypad: 1 2 ABC 3 DE 4G 5 11 6 MNO 7 PONS 8 Tu 9.xyz # For example, using letters & spaces, the telephone number 438-5626 can be shown as GET LOAN. In some cases, to make a telephone...

  • Programming Visual Basic 2010 Please post correct answer. Some of the questions I asked answered wrong...

    Programming Visual Basic 2010 Please post correct answer. Some of the questions I asked answered wrong before. Number Analysis: Create an application that reads the numbers from the file named NumberSet.txt .Your application should perform the following: 1) Display the total of the numbers 2) Display the average of the numbers 3) Display the highest number in the file. 4) Display the lowest number in the file. Attachment: NumberSet.txt http://s000.tinyupload.com/?file_id=00184765431250246674 I need full programming code with all the comments and...

  • 1 CREATE A DOCUMENT (USE CHAPTER 20 FOR REFERENCE) 1. Using the Visual Basic Editor, create...

    1 CREATE A DOCUMENT (USE CHAPTER 20 FOR REFERENCE) 1. Using the Visual Basic Editor, create a VBA procedure named doc_create that does the following: a. Creates a new Word document. b. Adds 1 line of text that says “This is my document!” c. Saves the file as myFile.docx d. Closes the document.

  • An Introduction to Programming Using Visual Basic Tenth Edition Chapter 3 Programming Project 3 What is...

    An Introduction to Programming Using Visual Basic Tenth Edition Chapter 3 Programming Project 3 What is the solution to this project? Change X Amount of change: 93 Determine Composition of Change Quarters: 3 Dimes: 1 Nickels: 1 Cents: 3 FIGURE 3.63 Possible outcome of Programming Project 3. own in Fig. 3.62. 3. Change Write a program to make change for an amount of money from 0 through 99 cents input by the user. The output of the program should show...

  • 4B : C PROGRAMMING To make telephone numbers easier to remember, some companies use letters to...

    4B : C PROGRAMMING To make telephone numbers easier to remember, some companies use letters to show their telephone number. For example, using letters & spaces, the telephone number 438-5626 can be shown as GET LOAN. In some cases, to make a telephone number meaningful, companies might use more than seven letters. For example, 225-5466 can be displayed as CALL HOME,which uses eight letters. Write a program that prompts the user to enter a telephone number expressed in letters/spaces and...

  • Programming Microsoft Visual Basic 2012/2015 - Create an SQL or Access database with all your friends’...

    Programming Microsoft Visual Basic 2012/2015 - Create an SQL or Access database with all your friends’ information and write a program to load the names in the combo box and also search the database and find your friend’s record off the database by name and retrieve all the information from the database to the form including your friend’s picture. You should be able to add new friends, update an existing friends’ information and delete a friend’s record. See the sample...

  • VISUAL BASIC PROGRAMMING: Program 2. Football 2 You are to create a program similar to program...

    VISUAL BASIC PROGRAMMING: Program 2. Football 2 You are to create a program similar to program 1. In this program, the user will click on one of the names in the listbox (containing the same list of schools as in program 1), and the program will return the number of times this school has won the Rose Bowl. Note: There is no button in this form. Where does the code go? Rose Bowl 2 Number of Rose Bowls Won: Michigan...

  • An Introduction to Programming Using Visual Basic Tenth Edition Chapter 3 Programming Project 2 What is...

    An Introduction to Programming Using Visual Basic Tenth Edition Chapter 3 Programming Project 2 What is the solution to this project? one of the numbers in an input text box is change the type of Auto Repair Calculator X Customer: John Doe Hours of labor: 3.5 Cost of parts and supplies 84.55 Display Bill + First number 21 Second number 77 х Customer Labor cost Parts cost Total cost John Doe $122.50 $88.78 $211.28 21 x 77 = 1617 FIGURE...

  • ***************C PROGRAMMING ONLY************* Demonstrate the ability to create an array on the stack Demonstrate the ability...

    ***************C PROGRAMMING ONLY************* Demonstrate the ability to create an array on the stack Demonstrate the ability to create an array on the heap allowing user to choose the number of values to store. Demonstrate the ability to store an array of Struct values on both the stack and the heap. Program Specifications: 1. Create a struct with at least 3 fields - any struct you want but explain it in your comments in the code. Populate at least 10 elements...

  • Create Visual Basic projects to solve Programming Challenges 14 - Mass and Weight Scientists measure an...

    Create Visual Basic projects to solve Programming Challenges 14 - Mass and Weight Scientists measure an object's mass in kilograms and its weight in newtons. If you know the amount of mass an object, you can calculate its weight, in newtons, with the following formula: Weight=mass*9.8 Create VB application that lets the user enter an object's mass and calculates its weight. If the object weighs more than 1000 newtons, display a message indicating that it is too heavy. If the...

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
ADVERTISEMENT