Write a program that solves the quadratic equation ax2 + bx + c = 0.
The coefficients a, b, and c are passed as command-line arguments. Consider the case where the user provides an incorrect number of parameters.
Guidelines:
Write a program that takes two numbers (a and b) and a string as command-line arguments.
The program should extract a substring from the given string starting at index a (inclusive) and ending at index b (exclusive).
Example:
java Substring Welcome 2 4
This should output: elc
The program should then display the original string without the extracted substring. For the given example, it should output: Wome
Guidelines:
Write a program that generates a random number between 0 and 100. The program then prompts the user to guess the number. If the guess is incorrect, the program provides feedback by indicating whether the correct number is higher or lower than the user's guess. If the user guesses correctly, the program displays the number of attempts made and asks if the user would like to play again.
Write a program that verifies whether the parentheses in a given arithmetic expression are correctly matched.
The expression is provided as a single string of characters, using standard arithmetic operators.
The program should display a message indicating whether the parentheses are matched or not.
Guidelines: Refer to the java.util.regex package.
Write a program for creating a shopping list in text mode. The program reads a text file containing product categories and their items:
Example File:
Create a class `TelephoneNumber` with fields for country code and local number, implementing the `Comparable` interface.
Define an abstract class `TelephoneEntry` with an abstract method "description". Inherit classes `Person` and `Company` from `TelephoneEntry`.
Class `Person` should contain information about name, last name, and address (including `TelephoneNumber`).
Class `Company` should have name and address (including `TelephoneNumber`).
Create additional classes if necessary based on OOP principles.
Compose objects of `Person` and `Company` and place them in a `TreeMap` container, using `TelephoneNumber` as the key.
Then, list the created directory using an Iterator.
Guidelines:
Write a program that asks for vectors (mathematical sense) as input.
The end of the vector is marked by the enter key. Ignore non-numeric elements.
Try to add vectors if their lengths are equal.
Example input:
Develop a simple file-based database application offering functionalities
like Select, Insert, Update, and Delete commands.
Use JSON format for the database.
Implement a command-line interface and a proper SQL syntax parser (a MySQL command-line client can be used as an example)
(25 points)
Optional components: