Part 1: Select the Suitor Requirements In the great city of Atlantis, Prince Val had many suitors. He decided on the following algorithm to determine which person he would marry. First, the suitors would be lined up in order and assigned a number starting with 1, the second would be 2, and so on up to n suitors. Starting with the first, he would count down the line with each letter of his name "V", "a", "I", and then the suitor at "I" would be eliminated from the line. Val would continue counting three more suitors, and eliminating every third one. When Val reached the end of the line, he would resume counting at the beginning of the line. For example, if there were seven suitors, the elimination process would be as follows: 1234567 124567 12457 1457 145 14 4 Initial list of suitors; Start counting from 1. Suitor #3 eliminated; Continue counting at 4. Suitor #6 eliminated; Continue counting at 7. Suitor #2 eliminated; Continue counting at 4. Suitor #7 eliminated; Continue counting at 1. Suitor #5 eliminated; Continue counting at 1. Finally, #1 is eliminated, and Suitor # 4 is selected. Write a program that implements a linked list of nodes to determine the position a suitor should stand if they want to marry the prince, when there are n suitors. Your program should eliminate the suitor by deleting the node corresponding to the suitor for each step of the process. Each suitor also has a name. You should either add the name, a String, as part of the node object or use a parallel HashMap to perform a name lookup. Your program should prompt the user for the number of suitors, each suitor's name, and then after your algorithm runs, print the selected suitor and their name. Be sure to use prompts that make sense to a user who has never run your program before.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Need help writing the java code with the requirements below
starting with the following code
import java.util.Scanner;
public class Suitor {
public static void start (Scanner scnr) {
System.out.println("\n");
System.out.println("Select the suitor.");
}
}
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 5 images