Answer:
// program in java.
import java.util.*;
// class definition
class Main
{// main method of the class
public static void main (String[] args) throws java.lang.Exception
{
try{
// object to read input
Scanner scr=new Scanner(System.in);
// ask to enter name
System.out.print("Enter Your name: ");
// read name from user
String NAME=scr.nextLine();
// print message
System.out.println("Greetings,"+NAME);
}catch(Exception ex){
return;}
}
}
Explanation:
Read name from user with the help of scanner object and assign it to variable "NAME".Then print a Greetings message as "Greetings,NAME" where NAME will be replaced with user's input name.
Output:
Enter Your name: Rachel
Greetings,Rachel
Answer:
Following are the algorithm to this question:
y = 0 // initialize variable y that assigns the value 0
p = 1 // initialize value 1 in the variable p which also known as starting position
init num = 1//define variable num that assign value 1
for j = 1 to n: //defining loop
y = m[j] - m[p]
if (y > 10) //defining if block
num++; //increment num variable
p=i; //holding loop value in p variable
y= 0//assign value 0 in y variable
Explanation:
Following are the runtime analysis of the above-given algorithm:
The above-provided algorithm is greedy, but if it doesn't exceed the scope, it operates by greedily choosing its next object. Therefore the algorithm selects the fewest number of pens.
Running time:
This algorithm merely iterates once over all the points. The run-time is therefore O(n).
Hey there! Hello!
The answer to this problem will be D, "All Of The Above." I've attached a picture that shows the Shape Format tab in Microsoft Word. You can see in the dropdown that there's options for all three of your listed choices: Shape Fill, Shape Outline, and Shape Effects.
I hope this helped you out! Feel free to ask me any additional questions if you have any. :-)