Write a MATLAB script named Converter.m and MATLAB two functions, each in its own script, named D2BConverter.m and B2DConverter.m
The Selection Output should be the
following:
Binary to Decimal & Decimal to Binary Converter
Please Select:
1. Convert from Decimal To Binary
2. Convert from Binary To Decimal
3. Exit
If user select option [1] then you ask the user to enter a decimal number (whole number) and display the equivalent binary, else if the user select option [2] then ask the user to enter a binary number and display the equivalent decimal number, and if the user selects option 3 or any other entry exit the program with Thank you message.
disp('Please Select:')
disp('1. Convert from Decimal To Binary')
disp('2. Convert from Binary To Decimal')
disp('3. Exit')
prompt = 'Enter Your Option : ';
x = input(prompt)
if x ==1
prompt = 'Enter a decimal number (whole number) : ';
decimalNumber =
input(prompt)
binaryNumber = de2bi(decimalNumber);
disp('Binary Value is : ')
disp(binaryNumber)
elseif x == 2
prompt = 'Enter a binary number : ';
binaryNumber =
input(prompt)
decimalNumber = de2bi(binaryNumber);
disp('Binary
Value is : ')
disp(decimalNumber)
else
disp('Thank
you')
end;
Write a MATLAB script named Converter.m and MATLAB two functions, each in its own script, named...
Write a MATLAB script that asks the user to enter a whole number (i.e., any whole number, positive, negative or zero). After the number is entered, the program must utilize an IF-ELSE statement and determine the parity of the number. The parity of a number is simply whether it is an even number or an odd number. If the number is even, MATLAB must then generate and display the message: The entered number is an even number. Otherwise, MATLAB must...
Create a new MATLAB Script file named MT3P3_itname.m. In your script file perform the following calculations: Prompt the user to enter an integer. Use a multiple if-elseif structure to determine the following: Confirm that the number is an integer. If not, the program displays message 1. Check if the number is divisible by 2 and displays message 2. Check if the number is divisible by 3 and displays message 3. For anything other than 1, 2, or 3, the program...
matlab
The Homework should be submitted as a script (.m) file Write a script areaMenu that will print a menu consisting of "Cylinder," "Circle," and "Rectangle." It waits for the user to choose from the menu then call the corresponding function of each choice as follows: 1- Cylinder will call the function (cyl) which prompts the user for the radius and height of the cylinder, then calculates and prints area of the cylinder. 2- Circle will call the function (cir)...
Problem 5 (10 points): MATLAB script-5 Write a script that will accept a single variable named S. The script should replace S with the square of S and repeat this process until S is either greater than 1015 or less than 1015. The script should return a value Q containing the number of times S was squared during the process. If S equals 1, the function should display a warning message and retun the value of Inf for Q Examples:...
CE – Return and Overload in C++ You are going to create a rudimentary calculator. The program should call a function to display a menu of three options: 1 – Integer Math 2 – Double Math 3 – Exit Program The program must test that the user enters in a valid menu option. If they do not, the program must display an error message and allow the user to reenter the selection. Once valid, the function must return the option...
Modular program mathlab: Write a program in Matlab that would continuously ask the user for an input between 1 and 6, which would represent the result of rolling a die. The program would then generate a random integer between 1 and 6 and compare its value to the value entered by user. If the user’s die is larger, it should display, “You got it” If the user’s die is smaller, it should display, “Nice try” If the results are the...
Write a script named listEmptyDir.sh that will do the following: (a) take a name of a directory as a parameter; (b) loop through all files in this directory and display their names; (c) if a file is a directory and has no files in it (empty directory), add the name of this empty directory to the file EmptyDir.txt in your current directory. If the number of parameters is not 1 or a parameter is not a directory, display the “usage”...
Write a contacts database program that presents the user with a menu that allows the user to select between the following options: (In Java) Save a contact. Search for a contact. Print all contacts out to the screen. Quit If the user selects the first option, the user is prompted to enter a person's name and phone number which will get saved at the end of a file named contacts.txt. If the user selects the second option, the program prompts...
Please use Matlab to solve and show your full codes
Write a script file Ask the user to enter sides of a triangle: a, b, c Check to see if the sides are all greater than 0 If they are: Use the function (triangle) that you created in your last homework problem (HW#5 problemttF) to calculate the area. command Display the results on the screen using fprintf write the results to disk using the fprintf command. If any of the...
1. Write a script that creates a user-defined database role named OrderEntry in the MyGuitarShop database. Give INSERT and UPDATE permission to the new role for the Orders and OrderItems table. Give SELECT permission for all user tables. 2. Write a script that (1) creates a login ID named “RobertHalliday” with the password “HelloBob”; (2) sets the default database for the login to the MyGuitarShop database; (3) creates a user named “RobertHalliday” for the login; and (4) assigns the user...