java) write a program that takes command line argument and compute the average of their maximum and minimum. make sure there are command line arguments being passed before you attempt to compute anything
Code:

Output:

Note: pass command line arguments as space separated values.
Raw Code:
import java.util.*;
public class Avg {
public static void main(String[] args) { // command
line arguments are stored in String args[].
// That's why i convert the every
number in the String args[] array to double in this code.
if(args.length == 0){ // If there
is no commandline arguments are passed
System.out.println("Please pass arguments");
}
else{
double
min=Double.parseDouble(args[0]); // Declaring minimum value as
first number in array
double
max=Double.parseDouble(args[0]); // Declaring maximum value as
first number in array
int n =
args.length; // Finding the length of the array
for (int
i=1;i<n;i++){
double num = Double.parseDouble(args[i]); //
Converting the number in String args[] array to double.
if(num > max){ // Checking if the new number
is greater then our max number or not.
max = num; // Changing the
max value to num.
}
if(num < min){ // Checking if the new number
is less then our min number or not.
min = num; // Changing the
min value to num.
}
}
double avg =
(max + min)/2.0; // Calculating the average of max and min numbers
in array.
System.out.println("Average of maximum and minimum numbers is: " +
avg); // Printing the average.
}
}
}
java) write a program that takes command line argument and compute the average of their maximum...
Using java write a program that takes a single, positive integer, n as a command-line argument. The program should then plot n evenly spaced points around a circle
Java!!! Write a program that takes a file name as its command line argument. It assumes the file is a binary data file and checks the first 4 bytes of the file to see whether they contain the integer −889275714. It outputs “yes” or “no” or an error message if there was an IOException generated. (Trivia question: Why test for that particular value? Hint: Try it on several .class files.)
Problem: Write a program that behaves as described below.If the first command-line argument after the program name (argv[1]) is “--help”, print the usage information for the program. If that argument is not “--help”, you are to expectargv[1]and subsequent arguments to be real numbers(C, integer, float, or double types)in formats acceptable to the sscanf()function of the C library or strings of ASCII chars that are not readable as real numbers. You are to read the numbers, count them and calculate the...
[loops] Write a java program that accepts a number, as command line argument and prints out “Hello, World!” that many times using a for loop. E.g. if the input number is 3, the program outputs: Hello, World! Hello, World! Hello, World! Keep it simple, please use the argument, not interact with the console. Thanks
Write a C++ program that takes two numbers from the command line and perform and arithmetic operations with them. Additionally your program must be able to take three command line arguments where if the last argument is 'a' an addition is performed, and if 's' then subtraction is performed with the first two arguments. Do not use 'cin' or gets() type functions. Do not for user input. All input must be specified on the command line separated by blank spaces...
FOR JAVA Write a program that takes two command line arguments: an input file and an output file. The program should read the input file and replace the last letter of each word with a * character and write the result to the output file. The program should maintain the input file's line separators. The program should catch all possible checked exceptions and display an informative message. Notes: This program can be written in a single main method Remember that...
I need help with a java program Write a program Enigma that takes a single String as a command line argument. Enigma should read the file specified by the String argument, add 5 to each byte, and leave the altered data values in a file whose name is the command line argument. Note that this "updating in place" is the most difficult part of this lab: java Enigma sophie.dat should read file sophie.dat, and upon completion, leave the modified data...
Part 1: Write a C program that takes an integer command line argument n, spawns n processes that will each generate a random numbers between -100 and 100, and then computes and prints out the sum of these random numbers. Each process needs to print out the random number it generates. name the program 003_2.c
Write a program that determines if a string (passed as a command-line argument) has all unique characters. The program must print the number of times each existing character appears, and then print whether or not they are all unique. Special requirements: You are NOT allowed to modify the input string or create any additional data structures (no arrays, lists, dictionaries, or other strings). You may have only one string (the one received as the command-line argument). You may have one...
Write a C program called test that takes one command line argument, an integer N. When we run test: ./test N the program will do this: the parent process forks N child processes each child process prints its process ID, exits the parent process waits for all child processes to exit, then exits