
please
there are some specific instructions on the question so i would
greatly appreciate if they are followed . thank you very much for
your time# module to genereate the random xvalues
import random
# to compute the square root value
import math
# method to read the number
def getNumber(msg):
print(msg)
x = input().strip()
if(x==""):
print("Missing input")
getNumber(msg)
else:
try:
x =
float(x)
except:
print("Invalid
input")
getNumber(msg)
return x
# method to compute the yvalues
def yOnEclipse(a,b,xValues):
xsqrd = [i**2 for i in xValues]
y=[]
y = [b*(math.sqrt(1-(x**2/a**2))) for x in
xValues]
return y
# method to verify the eclipse
def verifyPoints(a,b,xValues,yValues):
check =[]
check = [(x**2/a**2)+(y**2/b**2)==1 for x,y in
zip(xValues,yValues)]
return check
# main method
def main():
msg = "Enter the length of major Axis"
a = getNumber(msg)
msg = "Enter the length of minor axis"
b= getNumber(msg)
msg = "Enter number of point along major axis"
n = getNumber(msg)
# uniform() method to generate the random floating
point numbers in the given range
xValues =[round(random.uniform(0,a),2) for i in
range(int(n))]
yValues = yOnEclipse(a,b,xValues)
check = verifyPoints(a,b,xValues,yValues)
# ouput the values
print("X","Y","OnEclipse",sep="\t")
for x,y,c in zip(xValues,yValues,check):
print(x,y,c,sep="\t")
# called when executed directly without importing module
if __name__ == '__main__':
main()

please there are some specific instructions on the question so i would greatly appreciate if they...
follow the instructions inside. You are to implement the sequential search of array elements. User will enter a value (size) which represents the number of values to process The values entered will be stored in an array of type short that has 1000 elements User will enter size numbers The user will enter a search value The program will search the data for a specific value program will display a message in which element the value was found or display...
Please help code in c++ and use the answers you get from question 1
and 2 into the 3rd answer! Question 1 is first, question 2 is in
the middle, question 3 is last
Input Array (10 pts) te a function only (no main) that takes an array of doubles as a parameter as well as another integer rray. Create a for loop that asks the user to input any real number between-100 and r each element of the array....
I should use the array and loop to create a java program
according to the instruction, but I have no idea how to do
it.
Introduction This lab assignment continues to give you practice using loops, particularly loops with variable termination conditions, and it also provides you an opportunity to use one-dimensional arrays. Recall that an array is used to store a collection of data. The data can be values of Java primitive data types or else objects (for instance,...
Programming language C Please go through this carefully. Needs function void add(int *a1, int n, int *a2) Write a program addition.c that reads in an array (a1) of numbers, and creates a new array (a2) of numbers such that the first and last numbers of a1 are added and stored as the first number, the second and second-to-last numbers are added and stored as the second number, and so on. You need to check for even and odd length of...
Write a C program convert.c that converts each number in an array by the sum of that number plus 6 modulus 10. A sample input/output: Enter the length of the array: 5 Enter the elements of the array: 3 928 4 14 77 Output: 9 4 0 0 3 The program should include the following function: void convert(int *a1, int n, int *a2) The function converts every element in array a1 of length n to an output array a2. The...
Hi there, I'm bit frustrated to see that your website has a same question posted many times but no solution. Why? I have purchased subscription to get solution that claimed on your page. Why I can\t see the solution? For example, the following Question doesn't have a solution: Write a function, equalsArray that when passed two int arrays of the same length that is greater than 0 will return true if every number in the first array is equal to...
in c++ please Assignment Instructions: MAIN FUNCTION: Ask the user how many students were surveyed. Call a function called makeArray to define an array of integers with the number of elements equal to the number of students surveyed. Call a function called getStudentData to allow the user to enter the number of hours each student spent watching Netflix into the array. Call a function called getAverage to calculate and display the average of the hours entered. Call a function called...
Thank you!
/*Lab 8 : Practicing functions and arrays
Purpose:
*/
#include<iostream>
#include<fstream>
using namespace std;
int read_function(int array[], int, int);
int main()
{
int array[300], numba;
read_function(array[300]);
cout << "Enter a whole number between 2-20: " <<
endl;
cin >> numba;
read_function(numba);
return 0;
}
int read_funtion (int arr[300], int num, int Values)
{
int sum=0;
ifstream array_file;
array_file.open("Lab8.dat");
for(int i=0; i < 300; i++)
{
array_file >> arr[i];
cout << arr[i];
sum += i;
}
cout << sum;...
C++ please Possible algorithms – (1) use and modify the algorithm from program 2 if possible; (2) use unique value array; (3) use flag array (flags used to avoid counting a number more than 1 time); (4) compute frequency distribution (use unique and count arrays); (5) use count array to store the frequency of a number. No global variable are permitted in this assignment. Do not change the code provided only write the missing code. Write the missing C++ statements...
AND logic gate simulation in Python: Please fix the code below so that it efficiently performs the operation of the AND logic gate in Python. (Leave comments in the edited code about what you changed) #if both values are 1, return true, other wise return false print ("Logic Gate Simulation: AND gate") def AND(x, y): if x == True and y == True: return True else: return False def main(): x = bool(input("Please...