Question

Write a Visual Basics program that calculates the squares and cubes of the numbers 0 through...

Write a Visual Basics program that calculates the squares and cubes of the numbers 0 through 5 and displays the resulting values in table format as follow:

Number Square Cube
0 0 0
1 1 1
2 4 8
3 9 27
4 16 64
5 25 125
0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

Module VBModule

Sub Main()
Console.WriteLine("Number{0}Square{1}Cube",Chr(9),Chr(9))

For number As Integer = 0 To 5
Console.WriteLine("{0} {1} {2} {3} {4}", number,Chr(9), number * number,Chr(9), number * number*number)
Next

Console.ReadKey()

End Sub
  
End Module

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Write a Visual Basics program that calculates the squares and cubes of the numbers 0 through...
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
  • QUESTION 12 Write a program that would prompt the user to enter an integer. The program...

    QUESTION 12 Write a program that would prompt the user to enter an integer. The program then would displays a table of squares and cubes from 1 to the value entered by the user. The program should prompt the user to continue if they wish. Name your class NumberPowers.java, add header and sample output as block comments and uploaded it to this link. Use these formulas for calculating squares and cubes are: square = x * x cube = x...

  • Using Java loops Write a program that finds all the perfect squares and cubes of numbers...

    Using Java loops Write a program that finds all the perfect squares and cubes of numbers from 1 to a number entered by the user. If the number it is examining is a perfect square, it prints the number user followed by “ is a perfect square” If the number it is examining is a perfect cube, it prints the number user followed by “ is a perfect cube”

  • Python Script format please! 1. Write a script that takes in three integer numbers from the...

    Python Script format please! 1. Write a script that takes in three integer numbers from the user, calculates, and displays the sum, average, product, smallest, and largest of the numbers input. Important things to note: a. You cannot use the min() or max() functions, you must provide the logic yourself b. The calculated average must be displayed as an integer value (ex. If the sum of the three values is 7, the average displayed should be 2, not 2.3333). Example:...

  • 2. Write a program to display the cube of the number up to a given integer....

    2. Write a program to display the cube of the number up to a given integer. Test Data: Input number of terms : 5 Expected Output : Number is : 1 and cube of the 1 is :1 Number is : 2 and cube of the 2 is :8 Number is : 3 and cube of the 3 is :27 Number is : 4 and cube of the 4 is :64 Number is : 5 and cube of the 5...

  • Using C# and including comments: Name this project SquaresAndCubes Write a Console Application initializes a variable...

    Using C# and including comments: Name this project SquaresAndCubes Write a Console Application initializes a variable to an integer value then prints out a table with the number, its square, and its cube. The program then adds one to the value and does the same on the next line. The program then adds one to the value again and does the same on the third line. The program then adds one to the value again and does the same on...

  • Use Matlab to write a program to display the cube of the number up to a...

    Use Matlab to write a program to display the cube of the number up to a given integer. (USE BOTH FOR & WHILE LOOPS PLEASE) Test Data: Input number of terms : 5 Expected Output : Number is : 1 and cube of the 1 is :1 Number is : 2 and cube of the 2 is :8 Number is : 3 and cube of the 3 is :27 Number is : 4 and cube of the 4 is :64...

  • Write a program that reads two integer values. It then calculates and displays the sum and...

    Write a program that reads two integer values. It then calculates and displays the sum and average of all values between them, Le. if the first value is vi and the second value is 2, then the program calculates and displays the sum and average of all values in the closed range Iv1,2 Your Program must satisfy the following constraints: A. make sure that v1 is less than 2 B. Use a function named getStats(that takes two integer yalues as...

  • 5. (30 pts) Write a program that calculates the surface area of a cube (see the...

    5. (30 pts) Write a program that calculates the surface area of a cube (see the formula below). The user inputs the cube's side length and your program will then print out the surface area of that cube. Your code must follow the output in the sample run below. Your program must be complete and correct, but you do not need to include comments. Here is the formula to calculate surface area given a cube's side length: surface area 6...

  • Write a C++ program to calculate the value of y = x2 for all values of...

    Write a C++ program to calculate the value of y = x2 for all values of x where x = 1, 2, 3, 4, 5. Use nested FOR statement to calculate and display the results as shown on the table below. Compile and run the program then submit the CPP file. x y^2 a^3 a^4 a^5 1 1 1 1 1 2 4 8 16 32 3 9 27 81 243 4 16 64 256 1024 5 25 125 625...

  • Write while loop to display the numbers from 10 through 1 and the squares. The output...

    Write while loop to display the numbers from 10 through 1 and the squares. The output should display as following: n squared 10 100 9 81 8 64

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