Answer:
See explaination
Explanation:
MinMax.java
import java.util.*;
public class MinMax
{
static void MinMax(int[] arr)
{
int Min=arr[0]; // initializinf min and max with 1st value of array
int Max=arr[0];
for(int i=0;i<arr.length;i++) // iterating loop only once
{
if(arr[i]>Max) // checking max value
{
Max=arr[i];
}
if(arr[i]<Min) // checking min value
{
Min=arr[i];
}
}
System.out.println("Min Number is "+Min); //printing min value
System.out.println("Max Number is "+Max); //printing max value
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter N value: "); // taking n value
int n=sc.nextInt();
int[] arr=new int[n];
System.out.println("Enter N elements:"); // taking n elements into array
for(int i=0;i<n;i++)
{
arr[i]=sc.nextInt(); // each element into the array
}
MinMax(arr); // calling MinMax() method.
}
}
Answer:
Please look for your answer on Stack Overflow, it's way better.
Explanation:
The opportunity cost for LeBron James was having to choose whether he should play college basketball and then risk injury or to enter the NBA draft.
<h3>What is an opportunity cost?</h3>
An opportunity cost is also referred to as alternative forgone and it can be defined as the value, profit or benefits that are given up and forfeited by an individual or business firm, in order to choose or acquire something that is deemed most significant at a particular point in time.
In this context, we can infer and logically deduce that the opportunity cost for LeBron James was having to choose whether he should play college basketball and then risk injury or to enter the NBA draft.
In conclusion, LeBron James was left with the choice of choosing between playing college basketball and then risk injury or to enter the NBA draft.
Read more on opportunity cost here: brainly.com/question/8846809
#SPJ1
Answer:
5
Explanation:
The code print out the length of the string "stuff" which equals 5.