Question

In: Computer Science

I am having problems getting the second button part of this to work. this is for...

I am having problems getting the second button part of this to work. this is for visual basic using visual studio 2017. Please help.

Create an application named You Do It 4 and save it in the VB2017\Chap07 folder. Add
two labels and two buttons to the form. Create a class-level variable named strLetters
and initialize it to the first 10 uppercase letters of the alphabet (the letters A through J).
The first button’s Click event procedure should use the appropriate character’s index to
display the fifth letter from the strLetters variable (the letter E) in the first label. The
second button should use a loop and the appropriate indexes to display the letters CDEF
in the second label. Code the procedures. Save the solution and then start and test the
application. Close the solution.

Solutions

Expert Solution

Design

Coding

Alphabet.vb

Public Class Alphabet
Public strLetters As String = "ABCDEFGHIJ" 'Make class lavel variable declare here
End Class

Form1.vb

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click ''if button one click then it invoke this code
Dim a1 As New Alphabet ''take new object of class Albphabet
Label1.Text = a1.strLetters.Substring(4, 1).ToString ''output display
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim a1 As New Alphabet 'take new object of class Albphabet
Dim str As String = "" 'take new string
For i As Integer = 2 To 5
str = str + a1.strLetters.Substring(i, 1).ToString ''string value concate here from index 2 to 5
Next
Label2.Text = str ''output display
End Sub
End Class

Output:

if you still have any Problem regarding this question please comment and if you like my code please appreciate me by thumbs up thank you.........


Related Solutions

I am having a hard time getting my an output after putting in the second set...
I am having a hard time getting my an output after putting in the second set of functions and I was hoping to be able to have the results from the functions be rounded to 2 decimal places. <html> <head> <title>Length Conversion</title> <script language='JavaScript' type='text/JavaScript'> <!-- function validate(type) { if(document.my_form.textinput.value=='') { alert('Fill the Input box before submitting'); return false; }else{ if(type=="to_feet"){ var res=3.2808*document.my_form.textinput.value; var unit=" feet"; }else{ var res=0.3048*document.my_form.textinput.value; var unit=" meter"; } document.getElementById("result").innerHTML=res.toFixed(2) + unit; return false; } }...
I am having an issue with the code. The issue I am having removing the part...
I am having an issue with the code. The issue I am having removing the part when it asks the tuter if he would like to do teach more. I want the program to stop when the tuter reaches 40 hours. I believe the issue I am having is coming from the driver. Source Code: Person .java File: public abstract class Person { private String name; /** * Constructor * @param name */ public Person(String name) { super(); this.name =...
I am taking a Data Structures and Program Design class. BUT, I am having trouble getting...
I am taking a Data Structures and Program Design class. BUT, I am having trouble getting access to the vectors so that I can compare the guesses with the random numbers. I’ve been working on this for several days and don't feel any closer to a solution and could really use some help as I really don't know how to get this to work. Thank you! The assignment is: Design an ADT for a one-person guessing game that chooses 4...
This assignment is For a C++ class , I am having difficulty with getting the boolean...
This assignment is For a C++ class , I am having difficulty with getting the boolean statements the most; getting them set up properly inside the int main() area. You have been asked to define a tip-calculating function named calcTip that could be integrated into a larger piece of software designed to improve guest service at a restaurant. As a result, you must conform to the function specification used throughout the rest of the project's code: double calcTip(double checkAmount, bool...
I am working on an accounting assignment and am having problems. Firstly, 1.I need to journalize...
I am working on an accounting assignment and am having problems. Firstly, 1.I need to journalize these entries and post the closing entries 2. i need to prepare Dalhanis multi-step income statement and statement of owners equity for August 2010 3. i need to prepare the blance sheet at august 31,2010 4. i need to prepare a post-closing trial balance at august 31,2010 DALHANI makes all credit sales on terms 2/10 n/30 and uses the Perpetual Inventory System Aug 1...
I am working on an accounting assignment and am having problems. Firstly, 1.I need to journalize...
I am working on an accounting assignment and am having problems. Firstly, 1.I need to journalize these entries and post the closing entries 2. i need to prepare Dalhanis multi-step income statement and statement of owners equity for August 2010 3. i need to prepare the blance sheet at august 31,2010 4. i need to prepare a post-closing trial balance at august 31,2010 DALHANI makes all credit sales on terms 2/10 n/30 and uses the Perpetual Inventory System Aug 1...
I am having a hard time getting started on how to do this assignment. I would...
I am having a hard time getting started on how to do this assignment. I would like some ideas on how to start the MEMO. and maybe some ideas on what you would include. But I don't necessarily need the assignment completed for me. just need ideas!!! One routine negative message in the form of an internal memo. 400-500 word message. Single-spaced, with 1-inch margins on all sides. Objective: To announce organizational restructuring, one routine negative message addressed to employees....
I am trying to get this code to work but I am having difficulties, would like...
I am trying to get this code to work but I am having difficulties, would like to see if some one can solve it. I tried to start it but im not sure what im doing wrong. please explain if possible package edu.hfcc; /* * Create Java application that will create Fruit class and Bread class * * Fruit class will have 3 data fields name and quantity which you can change. * The third data field price should always...
I am having problems with : If 6 is selected, then you will get an employee...
I am having problems with : If 6 is selected, then you will get an employee pay amount from the user. This will be a double. Only allow them to enter one pay amount and then display the main menu again. AND: if 2 is selected you will promt the user for a grade (double) from 0-100. Only allow them to enter one grade and then display the main menu again The project: Create a project called P03. Inside of...
I am having trouble with my assignment and getting compile errors on the following code. The...
I am having trouble with my assignment and getting compile errors on the following code. The instructions are in the initial comments. /* Chapter 5, Exercise 2 -Write a class "Plumbers" that handles emergency plumbing calls. -The company handles natural floods and burst pipes. -If the customer selects a flood, the program must prompt the user to determine the amount of damage for pricing. -Flood charging is based on the numbers of damaged rooms. 1 room costs $300.00, 2 rooms...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT