MATLAB ONLY PLEASE...ALSO AS SIMPLE AS POSSIBLE...NEW TO LANGUAGE
Write a code that will ask the user to input a positive number x.
If the number is negative the program will keep asking again and again (as long as the value is negative) until the user inputs a positive value. At the end of the program, calculate the following:
y = e-x
x=input('Enter x: '); while x < 0 x=input('Enter x: '); end y=e-x; disp(y) plot(x,y)
MATLAB ONLY PLEASE...ALSO AS SIMPLE AS POSSIBLE...NEW TO LANGUAGE Write a code that will ask the...
photo of the code please and an explnation if possible, Construct a simple MATLAB function program my_factorial which calculates product of first n positive integer numbers (i.e. find factorial n!). For full points: - Make sure you protect the code from illogical use (n must be positive integer) - Test the function by comparing with built in MATLAB function factorial(n) - Make sure you test your function for any limitations. O marks) -3. Using my factorial function from the previous...
*********C Language******* Write a file final_main.c 4. Inside main(void): Write a loop that oops until the entered number is 0 or negative 5. Ask the user to enter a positive int between 0 and 10 inclusive 6. If the number is < 1, it terminates. 7. Else: call the above four functions 8. Print the result of each function after its call. Q2. Write a program that removes the punctuations letters from a file and display the output to the...
write a c++ code be sure the user only enter A or a for packageA, B or b for packageB, C or c for packageC. If the user inputs some other value display an error message saying " invalid out". When you ask the user to input the number of minute and the user enters a negative value you should display the same error message "invalid input" in both cases, after you display the error message the program should stop...
A simple game of chance Using a while loop write a simple coin flip game. Specifics: The user starts with a bank of $10.00 It costs a dollar to play A correct guess pays $2.00 The while loop is used for the game loop. It should ask if the user wants to play. The while loop will check for a value of 'Y' or 'N'. You should also allow for lower case letters to be input. You MUST prime the...
read instructions carefully please matlab only Write a MATLAB function for a BMI calculator that receives the inputs for body weight (lbs)and height (ft) from the user's program, calculates the BMI using the equation below, displays the BMI category, and outputs the BMI value tothe user's program W (kg) h2 (m2) BMI Display Normal if 18.5 s BMI 25 Display Overweight if 25 s BMI <30 Display Obese if BMI 2 30 Else display underweight So you will create two...
In Java Write a program that will ask the user for integers and print if the integer is positive, negative or zero. The program should continue asking for integer until the user enters a negative value.
Write code to repeatedly ask the user for a number. If the number is positive and even, print out a happy message. If the number is positive and odd, print out a sad message. If the number is negative, print out an angry message If they enter zero, stop asking If they enter something that isn't an integer, print out a message telling them they are an idiot, but keep looping
Need help with code using pointer only in C Ask the user to enter a number between 1 and 10 •Check if the user has complied. •Keep asking the user for a number between 1 and 10 until the user complies. •Then calculate N! (no recursion)
use c++ language, keep it simple i am using code block Exercise#2: Arrays with Random Numbers Write a program that generates n random numbers as follows: Asks the user to input a positive integer n Asks the user to input the maximum value (say m) for the integers to be generated. Write a program that generates the n numbers in the range 0 to m. The program stores the generated numbers in an array A[ Asks the user to enter...
In this assignment, you will design a simple application which will take stream of numbers and display the summation at the end of the program. The application will keep asking for user numbers and keep adding. The user input will be integer numbers and can be positive or negative. The program will repeat until user types “EXIT” which indicates the user wants to exit the program. After exiting, the program will display the summation of the numbers they entered. For...