Question

Take 10 numbers from the user. Calculate their mean and median with your code, not using builtin Matlab functions. Print these values on the screen with a special format using the command: fprintf.

Answer #1

Ques:

Ans:

**Matlab code:**

clear all ;

close all;

clc

x = 'enter the 10 point like [x1 x2 x3 ... x10] ' ;

data = input(x) ; %take data from user

input_data = data

input_sort = sort(data)

n = length(data)

mean_value = sum(data)/n

median_value = (input_sort((n/2)) + input_sort((n+2)/2))/2 % n
should be even in this case

fprintf('mean value of 10 input data = %d \n ',mean_value)

fprintf('median value of 10 input data = %d \n ',median_value)

**Result:**

Using a for loop and range command, print the sequence
of numbers from 1 to 20 (skipping two numbers for each element);
that is, your code should print out the numbers 1,4, 7, 10, … (max
should not exceed 20). Use x as the variable name

Write a java code that allows the user to input any name (up to
10 only) and then sorts and alphabetizes them in an array without
using predefined methods (.compareTo(), or any sorter functions)
and then print out the results.

IN JAVA: Write code (using ArrayLists) to read
a line of input from the user and print the words of that line in
sorted order, without removing duplicates. For example, the program
output might look like the following:
Type a message to sort: to be or not to be that is the
question
Your message sorted: be be is not or question that the to
to

Write a script to display numbers from 1 to n, where n is an
integer provided by users (if not, default to 10). Hint: use “read”
command to accept user input.
a) Display the source code in an editor (#4-9)
b) Execute your script in the terminal, and display the command
and the result (#4-10)

In C++ Please,
Write a code fragment that uses a loop to calculate ln (i.e.
natural log), from values of ranging from ‘1’ through ‘10’ in steps
of ‘1’. Print out in this format:
Ln(1) = 0
Ln(2) = 0.6931
etc.

(java)
a. The following code has compilation AND logic errors. Rewrite
the code (using the while loop) so it will compile correctly and
print all the even numbers from 0 to 10 on one line separated by a
space:
int j = 0;
while j > 10 ;
j + 2;
System.println(j, “ “);
b.You want to print the values of integers a and b to an
external file “test123.txt”, assigned to the PrintWriter variable
output. Correct the following statements:...

x86 irvine library assembly code
Write a complete program that: 1. Prompt the user to enter 10
numbers. 2. save those numbers in a 32-bit integer array. 3. Print
the array with the same order it was entered. 3. Calculate the sum
of the numbers and display it. 4. Calculate the mean of the array
and display it. 5. Rotate the members in the array forward one
position for 9 times. so the last rotation will display the array
in...

JAVA
Prompt the user for 10 numbers using a while loop. Create an int
variable number. You have three additional int variables pos, neg,
and zero. Your goal is to determine the number of positive,
negative, and zeroes in the list of the ten numbers read in.

Uses a while loop to print the numbers from 3 - 19.
Uses a do-while loop to print the numbers from 42 - 56.
Uses a for loop to print the numbers from 87 - 95.
Asks the user for 2 numbers. Uses a loop to print all numbers
between the given numbers, inclusive.
Note: Consider that your user's second number can be lower!
(see example below)
Note: Also consider that your user might give you two of the
same...

Use Matlab to calculate the probabilities in the following
scenarios. Provide your code as well as your answer.
Hint: You will find the following Matlab functions useful:
normcdf(), normrnd()
(a) IQ tests are designed in such a way that the mean and
standard deviation are equal to 100 and 15 respectively. What is
the probability of having an IQ score of 130 or more?
(b) What is the probability of having an IQ between 110 and
130?
(c) Bolts for...

ADVERTISEMENT

Get Answers For Free

Most questions answered within 1 hours.

ADVERTISEMENT

asked 20 minutes ago

asked 26 minutes ago

asked 45 minutes ago

asked 46 minutes ago

asked 55 minutes ago

asked 58 minutes ago

asked 1 hour ago

asked 1 hour ago

asked 2 hours ago

asked 3 hours ago

asked 3 hours ago

asked 3 hours ago