design an algorithm that will display to the screen the first 20 numbers, with their squares and cubes, as follows:
#include <iostream>
using namespace std;
int main()
{
cout<<"Number\tSquare\tCube"<<endl;
for(int i=1;i<=20;i++) {
cout<<i<<"\t"<<i*i<<"\t"<<i*i*i<<endl;
}
return 0;
}
Output:
$g++ -o main *.cpp $main Number Square Cube 1 1 1 2 4 8 3 9 27 4 16 64 5 25 125 6 36 216 7 49 343 8 64 512 9 81 729 10 100 1000 11 121 1331 12 144 1728 13 169 2197 14 196 2744 15 225 3375 16 256 4096 17 289 4913 18 324 5832 19 361 6859 20 400 8000
design an algorithm that will display to the screen the first 20 numbers, with their squares...
1.
Create the algorithm for the following problem. Considering the first 20 natural numbers, calculate the sum of these numbers, the sum of their squares, and the sum of their cubes. Display all the sums at the end of the solution. Post your response as flowchart or pseudocode.
Can I please have a simple pseudocode algorithm of
this problem.
1 Design an algorithm that will read a series of 50 integers at the terminal. The first integer is special, as it indicates how many more integers will follow. Your algorithm is to calculate and print the sum and average of the integers, excluding the first integer, and display these values to the screen.
Design a solution that asks user to input two numbers. The program shall display the message indicating the numbers are the same or different. Present your answer in algorithm and flowchart. (note: with Decision Logic)
8. Design a flowchart for sorting the following numbers using "Bubble Sort" algorithm. (20) 74 101 5 [74 10 1 5; N= length of array, a Hints: There are 5 (five) numbers. Let us assume the array, a Start drawing the flowchart as follows: Start For Input ac[74 10 1 5) Length of a False For k-0kcN-2:k-k+1 True
8. Design a flowchart for sorting the following numbers using "Bubble Sort" algorithm. (20) 74 101 5 [74 10 1 5; N=...
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
(do in Java ) The sum of the squares of the first ten natural numbers is, 12 + 22 + ... + 102 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)2 = 552 = 3025 Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 − 385 = 2640. Find the difference between the...
Help pls for assignment
2. Write an algorithm to display up to 10 user inputs 3. Write an algorithm to display print first 5 items in a collection. 4. Write an algorithm to read in 3 numbers. Display the largest number.
Write an Algorithm in Pseudocode for the Exercises Below Add 5 numbers that a user enters by keyboard and display the Total on screen. Compute the area of a rectangle and display on screen based on length and width values that the user enters by keyboard. Compute the new price for a product that’s on sale for 10% off. Display new calculated price on screen. Assume current price is $25.00. Add the prices of an order of fries, a burger...
Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in the array and then display the following data: The lowest number in the array The highest number in the array The total of the number in the array The average of the numbers in the array PLEASE GIVE THE PSEUDOCODE AND CODE IN C PROGRAMMING
Design a simple full-screen editor on a video display terminal. The editor allows text to be inserted, deleted, and modified. Sections of text can be “cut” from one part of the file and “pasted” to another part of the file. The user can specify a text string, and the editor can find the next occurrence of that string. Through the editor, the user can specify margin settings, page length, and tab settings. Then, evaluate the quality of your design.