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

  • C++ program Write a program which: 1. Enters data into the 2D array of integers which...

    C++ program Write a program which: 1. Enters data into the 2D array of integers which is 5x5 The data should be entered with an assignment statement using nested for loops that is do not scan in the data. The data should be: 1 2 4 8 16 1 3 9 27 81 1 4 16 64 256 1 5 25 125 625 1 6 36 216 1296 2. Print out the following using a nested for loop Row 0:...

  • Instructions This program calculates the square root, cube root, and fourth root for the numbers 10...

    Instructions This program calculates the square root, cube root, and fourth root for the numbers 10 through 25. It demonstrates the sqrt() and pow() functions. Here is the code: Unit 5 Guided Practice 3.C 1 /* Filename: CHAP22-6.C Square, cube, and fourth root problem */ 4 5 #include <stdio.h> #include <math.h> 9 9 main() { int num; double square, cube, fourth; /*Variables must be float or double */ 12 14 for( num = 10; num <= 25; num++) { square...

  • Write a small program that will calculate squares of numbers 1 to 5 and print the...

    Write a small program that will calculate squares of numbers 1 to 5 and print the output as show below. [7 Marks] number 1, number squared 1 number 2, number squared 4 number 3, number squared 9 number 4, number squared 16 number 5, number squared 25 You want to determine the wavelength of two waves and the maximum possible wave height from the combination of the two waves. Produce an input/output diagram based on the above requirements.

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

  • Write a c# program in Microsoft visual studio to determine if the following numbers are even...

    Write a c# program in Microsoft visual studio to determine if the following numbers are even or not. Create an app that will read integers from an input file name Number.txt that will consist of one integer. Determine which numbers are even and which are odd. Write the even numbers to a file named Even.txt and the odd numbers to a file named Odd.txt. Number.txt 20 39 45 12 31 62 10 11 21 73 14 42 55 86 109...

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

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