Java | JSP | JSF Answers

Questions: 4 418

Answers by our Experts: 3 943

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

The placement season has begun in a college. There are N number of students standing outside an interview room in a line. It is given that a person who goes in first has higher chances of getting selected.
Input1- an integer N, which denotes the number of students present
Input2- An array of size N, denoting the problem solving capacity of the students.

Each student has a number associated with them known as the problem-solving capability (PSC). The higher the capability, the higher the chances of selection. Now, each student wants to know the number of students ahead of him/her who have more problem-solving capability than him/her.

Find this number for each student.

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




Special consideration needs to be made for the selection of the product category. Allow

the user to make a selection between the following categories:

• Desktop Computer.

. Laptop.

.

Tablet.

Printer.

• Gaming Console.
Q.1.2

If the user selects to capture a new product, you are required to save all the information supplied by the user into memory. To achieve this, you may use arrays or array lists.

Sample Capture Product Screenshot

CARTURE & NEW SODUCT

Inter the product code: Ass

Enter the product nass: EliteBook

Select the product category:

Laptop - 2

Caming Const

Product Category >>

Indicate the product warranty. Innar (1) for 6 months or any other tey for 2 years. 2 Enter the stock level for Elitalock 1 Enter the supplier for litellook IT 4 Africa Product details has been saved successfully!!!

Enter the price for EliteBook 15000

Intex (1) to launch masu úz any other key to exist

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


LATEST TUTORIALS
APPROVED BY CLIENTS