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
  • 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";...

  • 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...

  • Create a program using Visual Studio 2017 called dataExercise.c that declares the following variables and displays...

    Create a program using Visual Studio 2017 called dataExercise.c that declares the following variables and displays their values: 1. Declare a character variable with value 'a', and display the character using printf with a %c format. Then add a second printf that displays the character with a %d format. 2. 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...

  • ) Al Shams supermarket is a largest shopping center in Oman for electronic items and home...

    ) Al Shams supermarket is a largest shopping center in Oman for electronic items and home appliance. They want to create invoice for their customer after they supplying the goods. Write a Python program to ask the user to input the purchase amount, customer type ('O': Online or 'F': Offline) for 10 customers and store them in two different lists. The sample input data is shown below. [15 Marks) Purchase Amount=(100, 75, 110,300,150, 400, 200, 100, 140, 100] Customer Type...

  • Your app is computing and displaying tax for the user, in the format “Hello John Doe,...

    Your app is computing and displaying tax for the user, in the format “Hello John Doe, Your Tax is: ......” , where John Doe is the name entered, and .... indicates the tax amount as a dollar figure. Your form has two textboxes, where the user will enter his/her name, and income, and click a Submit button. Your app will store the name entered by the user into a variable of type String, and store the income into a variable...

  • Problems 9-35 odd numbers only(9,11,13,15 …35) k newNum numi (int) (4.6/2)1 . Do a walk-through to...

    Problems 9-35 odd numbers only(9,11,13,15 …35) k newNum numi (int) (4.6/2)1 . Do a walk-through to find the value assigned to e. Assume that all variables are properly declared. a -31 es" (a%b) * 6; e-(a b+ d)/ 4 10. Which of the following variable declarations are correct? If'a variable declaration is not correct, give the reasoníy) and provide the correct variable declaration. n = 12; char letter int one = 5, two; //Line 3 double x, Y zi //tine...

  • Problems: 1. Write a program to define the following variables, assign them values, and print their...

    Problems: 1. Write a program to define the following variables, assign them values, and print their values on screen: Integer x = 20, Float y = 40.45 Double z = 91.51e+5 Char w = A • • For the integer variable x, you need to print it in decimal notations, octal notations and hexadecimal notation. For the double variable y, you need to print it in double notations and scientific notation. 2. Write a program with the following three parts:...

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