Question

The following steps calculate the amount of a stock purchase: (a) Declare all variables as type...

The following steps calculate the amount of a stock purchase:
(a) Declare all variables as type Double.
(b) Assign the value 25.625 to the variable costPerShare.
(c) Assign the value 400 to the variable numberOfShares.
(d) Assign the product of costPerShare and numberOfShares to the variable amount.
(e) Display the value of the variable amount in a list box.

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

Code

Public Class Form1

Private Sub btnCompute_Click(sender As Object, e As EventArgs) Handles btnCompute.Click
Dim costPerShare, numberOfShares, amount As Double
costPerShare = 25.625
numberOfShares = 400
amount = costPerShare * numberOfShares
lstPrice.Items.Add("Stock Price: " + amount.ToString("C"))
End Sub
End Class

Design

output

If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.

Add a comment
Know the answer?
Add Answer to:
The following steps calculate the amount of a stock purchase: (a) Declare all variables as type...
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
  • Using C#, declare two variables of type string and assign them a value “The "use" of...

    Using C#, declare two variables of type string and assign them a value “The "use" of quotations causes difficulties.” (without the outer quotes). In one of the variables use quoted string and in the other do not use it. [25 pts]

  • My 3 friends would like to purchase a 40' sailboat and then sail to Mexico and...

    My 3 friends would like to purchase a 40' sailboat and then sail to Mexico and hang out in San Carlos for one year. Please calculate and display the cost of purchase and preparation for one year of travel. Initial costs for sailboat: Sailboat: $20,000.00 Sales Tax: =price of boat X .0775 Registration: 45.55 Insurance: =price of boat X .01 + 566.88 Preparation for trip: Haul and paint bottom: = length of boat X 45 New head sail: 2,300.00 Life...

  • Declare the following three variables: char letter; int number; double decimalNumber; Prompt the user to enter...

    Declare the following three variables: char letter; int number; double decimalNumber; Prompt the user to enter a letter. Read the letter into the variable   letter Assign to the variable   number   the value from the variable   letter Assign to the variable   decimalNumber   the value from the variable   number Print the values of the three variables using the following format: Character: K Number: 75 Decimal number: 75 Test the program with the input letter   a   and copy the results into a comment...

  • Write a C program that will do the following: 1.Declare four integers variables.   intVar1, intVar2, intVar3,and...

    Write a C program that will do the following: 1.Declare four integers variables.   intVar1, intVar2, intVar3,and intVar4. 2. Initialize intVar1 to the value 4; initialize intVar2to the value 5. 3. Declare four more integer variables. exp1, exp2,exp3, and exp4. 4. Declare a character variable charVar. 5. Assign the value of each expression below to variables exp1and exp2 respectively: exp1= intVar1 + ((5 * intVar2) / (3 * intVar1)); exp2 = intVar1 + (5 * (intVar2 / 3)) * intVar1; 6....

  • Write C++ statements that do the following: Define an enum type, birdType, with the values PEACOCK,...

    Write C++ statements that do the following: Define an enum type, birdType, with the values PEACOCK, SPARROW, CANARY, PARROT, PENGUIN, OSTRICH, EAGLE, CARDINAL, and HUMMINGBIRD. Declare a variable bird of the type birdType. Assign CANARY to the variable bird. Advance bird to the next value in the list. Decrement bird to the previous value in the list. Output the value of the variable bird. Input value in the variable bird. Write C++ statements that do the following: Define an enum...

  • 1- Correct the syntax errors in the following program, and rewrite the program so that it...

    1- Correct the syntax errors in the following program, and rewrite the program so that it follows the proper style conventions. What does the program do? (Write it out as a comment). (10 pts) #include <stdio.h> int main() {/* * Calculate and display the difference of two values *) int X, /* first input value */ x, /* second input value */ sum; /* sum of inputs */ X=9, x=7.5 X + x = sum; printf("%d + %d = %d\n";...

  • Challenge: C# Basics Description: Write a C# console application using .NET Core that utilizes constants, variables,...

    Challenge: C# Basics Description: Write a C# console application using .NET Core that utilizes constants, variables, data types, operators, expressions, statements, blocks, and control flow. Purpose: This application provides experience in working with basic language features of C#. It is important when working with a new language to understand how it handles its constants, variables, data types, operators, expressions, statements, blocks, and control flow. A good thing to always do with a new language is to build test applications where...

  • Create a program (in C, not C++) called lab3.c that declares the following variables and displays...

    Create a program (in C, not C++) called lab3.c that declares the following variables and displays their values: Declare a character variable with value 'a', and display the character using printf with %c format. Then add a second printf that displays the character with a %d format. Declare a short int variable with a value set to the maximum value of a short int (the maximum value for whatever machine I happen to use to grade your assignment - so...

  • Write a complete C program that does the following: . o Declare a and b as...

    Write a complete C program that does the following: . o Declare a and b as character variables. Initialize a to this value: 127 o Declare c as an unsigned character variable o Multiply a by 2 and store the result in variable b. o Multiple a by 2 and store the result in variable c. Print the values of a, b, and c. Use the %d specifier in each case. Declare d as an integer variable. Initialize d to...

  • This is an external javascript file // Problem 1:   Declare the variables num1, num2, ans1, //  ...

    This is an external javascript file // Problem 1:   Declare the variables num1, num2, ans1, //               greet1, greet2. Then initialize them to //               hold the values 1, 2, 0, "Hello", and //               "World", respectively. var num1 = 1; var num2 = 2; var ans1 = 0; var greet1 = "Hello"; var greet2 = "World"; // Problem 1a:   Display the values stored in the previous //               variables in 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