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.
#include<iostream>
using namespace std;
int main(){
int n = 5,i;
for(i=1;i<6;i++){
cout<<"number "<<i<<", number squared "<<(i*i)<<endl;
}
return 0;
}
//sample output

formula for determining wavelength is,
wavelenth = wavespeed/frequency
frequency = 1/Time
maximum possible wave height is the amplitude of the resulatant wave
combination of two wave will always increase the resulatant wave


Write a small program that will calculate squares of numbers 1 to 5 and print the...
I want solve it
Question (4): (5 marks) Write a Python program to print all even numbers in given list. Example: Input: list_1 = (2, 4, 5, 7, 13, 44, 45] Output: [2, 4,44]
Write a java program to print all the prime numbers below a certain given number. A prime number is defined as a number that can only be divided by 1 and itself. Requirements: 1. Accept the upper limit from the user as an integer. 2. You can assume the user input will be positive and smaller than INT MAX 3. Go from 1 to the number. If you happen to find a number that is prime, print it. The input...
Write a program to print all the prime numbers below a certain given number. A prime number is defined as a number that can only be divided by 1 and itself. Requirements: 1. Accept the upper limit from the user as an integer. 2. You can assume the user input will be positive and smaller than INT MAX 3. Go from 1 to the number. If you happen to find a number that is prime, print it. The input and...
1- Write a program to read 10 numbers and find the average of these numbers. Use a while loop to read these numbers and keep track of input numbers read. Terminate the while loop with a sentinel value. 2- Now modify the program to find the maximum of these numbers as well. The program should print the number of elements read as input and run until -1 is entered. (-1 is the sentinel that terminates the loop and the program)...
Write a C++ program that will calculate average of squares up to n. For example, if user enters 3 the function should display 1 + 4 + 9/ 3 = 4.6667. Requirements Created function to receive 1 parameter and no return parameter. Called the new function from main function inside a while loop. Calculated the sum of squares and average correctly in the new function using loop with no library functions. Sample Output ~~Enter a number ONLY between 1 and...
C- PROGRAMMING PROJECT #4 Design and Write a C program to calculate an average of an array of numbers and produce the following output: 1. Your first and last name 2. Course Number 3. C Project Number 4. All the numbers in the array 5. The sum of all the numbers in the array 6. The count of all the numbers in the array 7. The average of all the numbers in the array Double-space after lines 3, 4, 5,...
Write a program that will accept two numbers from the user. The program will then print all the numbers from the lowest number to the highest number. Make sure to include both numbers in the count. Also, it should not matter what order you input the two numbers. c++
Write a program in c++ that generates a 100 random numbers between 1 and 1000 and writes them to a data file called "randNum.dat". Then re-open the file, read the 100 numbers, print them to the screen, and find and print the minimum and maximum values. Specifications: If your output or input file fails to open correctly, print an error message that either states: Output file failed to open Input file failed to open depending on whether the output or...
java for netbeans
Question 2: (Print distinct numbers) Write a program that reads in ten numbers and displays the number of distinct numbers and the distinct numbers separated by exactly one space (i.e., if a number appears multiple times, it is displayed only once). (Hint: Read a number and store it to an array if it is new. If the number is already in the array, ignore it. After the input, the array contains the distinct numbers. Here is the...
Write a Python program to print all Perfect numbers between 1 to n. (Use any loop you want) Perfect number is a positive integer which is equal to the sum of its proper positive divisors. Proper divisors of 6 are 1, 2, 3. Sum of its proper divisors = 1 + 2 + 3 = 6. Hence 6 is a perfect number. *** proper divisor means the remainder will be 0 when divided by that number. Sample Input: n =...