Preview

Machine Problem Visual Basic

Powerful Essays
Open Document
Open Document
1102 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Machine Problem Visual Basic
Format:

Font Style/Size: Calibri – 12
Margins: Normal
Size: Legal 8.5” x 14”
Header and Footer : (same as this document)

Part 1: Source Code

*Use 2 Columns for the Source Code

Part 2: Screen Shoots

Note: This Machine Problem is compose of four problems .Just copy and paste your source code on a word document then print the screen shots after to show the output. Save your work on a rewritable CD. Submit your work with a long brown envelope.

Problem 1: “ The Name Game”

The name game takes a string as input (your name) and searches through it for various tidbits of information. It can tell you your first name and last name and how many characters your name have.

Sample Output:

Criteria: 1. First name must be entered first followed by the last name and must be separated using the space. 2. The output must be displayed using a message box. It will ask you if you want to try again. If yes , the textbox must be cleared the new input and if not the program will just simply end 3. The output name must be in upper case when displayed in the message box.

Thoughts to guide you:

Function Example
Left Left(“Visual Basic”, 4) results in “Visu”
Right Right(“Visual Basic”, 3) results in “sic”
Mid Mid(“2/24/72”, 3, 2) results in “24”
UCase UCase(“Number 7”) results in “NUMBER 7”
Trim Trim(“ Bob Jones “) results in “Bob Jones”
Len Len(“February”) results in 8
InStr InStr(“Visual Basic”, “Bas”) results in 8ON STRING AND
STRING-RELATED NUMERIC FUNCTIONS
Notice that I use double quotes when directly inserting a string into one of these functions. They are required unless you are using string variables. Also note that these functions do not take the same number of parameters or arguments. Some of the functions require only one argument, and others require two or three. Here’s what each of these functions is doing and what is required for their operation to be successful:

• The Left function

You May Also Find These Documents Helpful