Write a Java program that gets strings containing a person’s first name and last name as separate values, and then displays their “initials”, “name in address book”, and “username”. For example, if the user enters a first name of “John” and a last name “Smith”, the program should display “J.S.”, “John SMITH”, and “jsmith”.
Add a subclass named Finance_Period that will determine if a customer will pay interest or not. If the number of months to pay for the product is greater than three, the customer will pay 25% interest, else no interest applies. The maximum number of months to pay for the product is 12. Override the calculate_repayment () method by determining if the customer will pay interest or not and calculate the monthly repayment amount.
Create a class called Customer_Finance that contains the logic to test the two classes. Prompt the user for data for the first object where no interest applies and display the results; then prompt the user for data where interest is applicable and display the results.
10% discount to children who are not more than 12 years old or senior citizens who are at least 65 years old. It is further stated that ONLY those who are visiting the Park for at least the 5th time will qualify for this discount
public class KrugerNationalPark {
public static void main(String[] args){
String Age, Visit;
Age = 18;
Visit = 10;
decideDiscount(Age, Visit);
}
public static void decideDiscount(double A, char V)
{
if ((A <= 12 && >= 65) && (V >= 5));
System.out.print("You qualify for 10% discount!")
System.out.print("You deserve it!")
else
System.out.print("You do not qualify for discount")
}
}
the program is not executing due to at least 10 syntax errors.
1) You are required to debug the program and re-write the program without errors.
2) Re-write your program in such a way that method decideDiscount() can return a value to the calling method. The calling method will then display if a customer qualifies for a discount or not.
2. Write a java program named StampCalc.java. This program will input 3 int values from the command-line. The first will represent the number of First Class stamps requested, the second number will indicate the number of Additional Ounces needed for those first class letters, and the third number will indicate the number of International stamps requested.
The cost for First Class stamps is $.50, the cost for an Additional Ounce is $.21, and the cost for an International stamp is $1.15.
Your program will calculate the total cost for the requested number of stamps.
If the command-line values were: 5 2 6
Your output should show just one line:
The total for 5 First Class stamps, 2 additional ounces and 6 International stamps is $9.82
Create two interfaces such as MathsOperable and TrigonometricOperable which
contains the functions to perform the basic arithmetic operations (add, sub, mul, div,
mod) and trigonometric operations (sine, cosine, tan) respectively.Create an abstract class called “Calculator” with details such as no1, no2 and result. Add
necessary constructors.
Implement these interfaces and inherit the class in “Operation” class to perform the
specific operations.
Demonstrate the operations in a menu driven fashion from a Main class. Write logics in
the corresponding methods.
Design a java application that will allow a traffic department user to search for and view fines
Ever wondered how change is disbursed to customers in certain stores? In Namibia the following notes exists 200,100,50,20,10 and following coins: 5, 1, 50c, 10c, 5c. For the sake of this exercises let us only consider change below 50 see below example: Sample run 1: Enter item name: Apples Enter QTY of Apples: 2 Enter price per item N$: 3.25 Amount tendered N$: 50 Your change is: N$ 43.50 Disbursed as follows: 2 x N$20; 0 x N$10; 0 x N$5; 3 x N$1; 1 x 50c; 0 x 10c; 0 x 5c [Hint: make use of % and / operators to determine the values needed, see Pg. 113 for more info