CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 24

Hybrid View

  1. #1
    Join Date
    Jan 2002
    Posts
    2

    VB 6.0 collge help

    Happy new Year Everyone! I am currently a 2 year ISM major and I am having trouble answering 9 exercise questions. These questions are very short and simple but for an advance programmer but extremely difficult to me. I need help writing these simple textbook generic codes. If anyone can help me I would greatly appreciate it. I have then on file and the can be emailed for review upon request.

    Thanks again,
    MsTee


  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: VB 6.0 collge help

    I'm willing to have a look

    Tom Cannaerts
    slisse@planetinternet.be.remove.this.bit
    Moderator on http://www.vbcodelibrary.co.uk/board

    A bottomless pit, I'm sure it came with the place, who would dig one on purpose?
    Tom Cannaerts
    email: cakkie@cakkie.be.remove.this.bit
    www.tom.be (dutch site)

  3. #3
    Join Date
    Jan 2008
    Posts
    4

    Re: VB 6.0 collge help

    Hi

    I'VE JUST FINISHED THE ACTIVITIES BUT STUCK ON 7.7 WITH THE CODING. I CAN'T DO IT.

    PLEASE CAN YOU HELP ME.

    THANKS

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: VB 6.0 collge help

    you realize this is from 2002?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: VB 6.0 collge help

    David I guess this is relevant to this thread only. Because the exercise belongs to this thread.

    Zobi,
    Easiest thing to do is write down the steps on the paper first and then try to write the code for the same steps.

  6. #6
    Join Date
    Jan 2008
    Posts
    4

    Re: VB 6.0 collge help

    Does Anyone Know How To Write 2.5 Billion In Vb, Its Not Working, Very Confused

  7. #7
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: VB 6.0 collge help

    Quote Originally Posted by zobi316
    Does Anyone Know How To Write 2.5 Billion In Vb, Its Not Working, Very Confused
    How are you writing it? Show us the code. In case you are using integer or long then you should change it to double.

  8. #8
    Join Date
    Jan 2002
    Posts
    2

    Re: VB 6.0 collge help

    First, let me thank you for responding so quickly. Any help you can offer will be greatly appreciated. The following are the exercises that are giving me much difficulty:


    2.4 You have a form with a text box, txBox, and a command button, cmdButton1. Write instructions such that when the button is selected, the words “Button Pressed” appear in the text box.

    2.5 You have a form with two text boxes, txtBox1 and txtBox2, and two command buttons, cmdButton1 and cmdButton2. Write the instructions such that when cmdButton1 is selected, the contents of txtBox1 are copied to txtBox2, and when cmdButton2 is pressed, the contents of txtBox2 are copied in txtBox1.


    2.6 You have a form with two text boxes, txtBox1 and txtBox2. Write the instructions such that the text box with focus has bold text, and the text box without focus has normal (not bold) text.

    2.7 You have a picture box, picOutput, and command button, cmdCompute. Write the instructions such that when cmdCompute is selected, the answer to the following problem is displayed: “If 30 people eat 45 hamburgers, how many hamburgers will 50 people eat?”


    2.8 You have a form with three boxes, txtBox1, txtBox2 and txtOutput, and a command button, cmdCompute. Write instructions such that when the button is selected, the numerical values in txtBox1 and txtBox2 are multiplied together and the result is displayed in txtOutput.

    2.9 You have a form with three text boxes, txtBox1, txtBox2 and txtOutput, and a command button cmdCompute. Write the instructions such that when the button is selected, the strings in tctBox1 and txtBox2 are concentrated and the results is displayed in txtOutput.

    2.10 You have a form with a text box, txtBox, a label, lblOutout, and a command button, cmdbutton, cmdCompute. Write the instructions such that the user can enter a value in the text box representing an amount of money, click on the button, and then the label displays the amount of money that would be earned in three years of compound interest at 5%.

    3.6 Write a program that reads three strings from a data file and displays the first three letters of each string.

    4.5 You have a command button, cmdShowerLength, and two text boxes, txtInput and txtDisplay. Write code such that when cmdShowerLength is clicked, txtDisplay shows the number of characters in the txtInput. The output in txtDisplay should be produced by a call to Sub procedure named Length.

    4.6 You have a command button, cmdShow, and a picture box, picOutput. Write Sub procedure, called Doubler, that takes a parameter and doubles it. Use this Sub to write code such that when cmdShow is clicked, the first four powers of 2 ( that is 2,4,8,16) are displayed in picOutput.

    5.5 Write a function that takes a number of years and returns the equivalent number of months. Write another function that takes a number of years and returns the equivalent numbers of days (ignore the possibly of leap years). Combine these functions in a program that has a text box, a command button, and a picture box. When the command button is clicked, the number of years in the text box is converted to months and days and displayed in the picture box.

    6.5 Suppose, in a certain country, income tax is computed as follows: 18% of income, with a minimum of $1,000. Write a program that takes an income as input and produces the tax amount as output.

    6.6 Suppose the country in the previous question modifies its income tax law. People earning less than $35,000 pay the same as before, 18% with a minimum of $1,000. However, people earning $35,000 or more now pay $6,800 + 25% of the income over $35,000. Modify your previous program to account for this change.

    6.7 Write a program that makes an abbreviation from the following list of computer terms, and displays the full term. Make use of the Select-Case.
    CS Computer Science
    CD Compact Disc
    DTP Desktop Publishing
    OCR Optical Character Recognition

    7.7 Suppose the population of a certain country was 125,000 at the beginning of the year 1995. The population is growing at a rate of 4.3% per year. Write a program that determines in what year the population will reach or exceed 200,000.

    7.8 Write a program that receives an initial amount, a percentage of yearly compound interest, and a number of years, and then computes how much money would e in the account after that number of years. Make use of a For loop in your calculations.

    8.4 Write a Sub called AddTitle that takes an array of Strings as a parameter and, for each String, adds the prefix “Dr”. Use Lbound and Ubound so that your SUB works on any size array. Write a test program for your Sub that crates an array of the following strings, calls the Sub, and then displays the results.

    “Kildar”, “Zhivago”, “Spocks”, “Roberts”

    8.5 You have a form with a control array of four text boxes, txtInput, a command button, cmdAverage, and a label, lblAverage. Write code such that when cmdAverage is clicked, lblAverage is displays the average of the numbers in the four text boxes. Use a loop in performing the calculation.



  9. #9
    Join Date
    Jan 2002
    Posts
    63

    Re: VB 6.0 collge help

    2.4 answer:

    Private Sub cmdButton1_GotFocus()
    txBox.Text = "Button Pressed"
    End Sub

    2.5 answer:

    Private Sub cmdButton1_GotFocus()
    txBox2 = txBox1
    End Sub

    Private Sub cmdButton2_Click()
    txBox1 = txBox2
    End Sub


    halforc


  10. #10
    Join Date
    Aug 2000
    Location
    Ottawa, Canada
    Posts
    469

    2.6


    private Sub Text1_GotFocus()
    Text2.FontBold = false
    Text1.FontBold = true
    End Sub
    '
    private Sub Text2_GotFocus()
    Text1.FontBold = false
    Text2.FontBold = true
    End Sub





  11. #11
    Join Date
    Nov 2001
    Posts
    4

    Re: VB 6.0 collge help

    I strongly believe that this excersize should be done by the student himself.
    It is not fair to answer these questions as that wouldn't help the student. These are very fundamental questions in VB and answering them should be very easy for one who had attended a week lab or went through first few chapters in any VB book.


  12. #12
    Join Date
    Jul 2011
    Posts
    1

    Re: VB 6.0 collge help

    Gan hi help me?
    nie Q form for the transaction (the last), and hold the contents of its input text box from another form, continue if its text box contains "" then the command button visible = true how do I call her to his command button that?

  13. #13
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: VB 6.0 collge help

    Form2 variables have to be Public for Form1 to see them.

    To check the textbox on form 2 to see if it is empty from form1
    Code:
    if Form2.Text1 = "" then Debug.Print "It's EMPTY"
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  14. #14
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: VB 6.0 collge help

    @gendon101 :

    #1 : do not hijack other peoples threads, start your own...

    #2 : this thread is over 3 years old!!!!
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  15. #15
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: VB 6.0 collge help

    Actually 9 years old and then raised from the dead 3 years ago and once again.
    Always use [code][/code] tags when posting code.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured