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

Write a java program that specifies three parallel one dimensional arrays name length, width, and area. Each array should be capable of holding a number elements provided by user input. Using a for loop input values for length and width arrays. The entries in the area arrays should be the corresponding values in the length and width arrays (thus, area[i] = length [i]* width [i]) after data has been entered display the following output: Length Width Area -------- -------- ------- 25 2.6 65.00 18.2 4.9 89.18 Sample Run1 Enter the array size: 5 Enter the Length and Width for Rectangle 1: 25 2.6 Enter the Length and Width for Rectangle 2: 18 4.9 Enter the Length and Width for Rectangle 3: 100 3.27 Enter the Length and Width for Rectangle 4: 1.84 7.4 Enter the Length and Width for Rectangle 5: 56 9.5 Output1: Length Width Area -------- -------- ------- 25 2.6 65.00 18.2 4.9 89.18 100 3.27 327.00 1.84 7.4 13.62 56 9.5 532.00

Write a java program that simulates a lottery. The program should have an array of five integers named lottery and should generate a random number in the range of 0 through 9 for each element in the array.

The user should enter five digits, which should be stored in an integer array named user. The program is to compare the corresponding elements in the two arrays and keep a count of the digits that match. For example, the following shows the lottery array and the user array with sample numbers stored in each. There are two matching digits (elements 2 and 4).

lottery array: 7 4 9 1 3

user array: 4 2 9 7 3


The program should display the random numbers stored in the lottery array and the number of matching digits. If all of the digits match, display a message proclaiming the user as a grand prize winner.


Input Validation: Do not accept a negative value for lottery number. Also keep track of array size.


Write a program that simulates a lottery. The program should have an array of five integers named lottery and should generate a random number in the range of 0 through 9 for each element in the array. The user should enter five digits, which should be stored in an integer array named user. The program is to compare the corresponding elements in the two arrays and keep a count of the digits that match. For example, the following shows the lottery array and the user array with sample numbers stored in each. There are two matching digits (elements 2 and 4). lottery array: 7 4 9 1 3 user array: 4 2 9 7 3 The program should display the random numbers stored in the lottery array and the number of matching digits. If all of the digits match, display a message proclaiming the user as a grand prize winner. Input Validation: Do not accept a negative value for lottery number. Also keep track of array size.
Java program Create a class “Area” to calculate the area of rectangle, triangle and circle by simply using class syntax through objects.
Create a class called Date that has separate int member data for date, month and year. One member function should take the input from the user. Another member function should contain fixed values. Another member function should display the date, in 26-10-2021 format.

Write an application named BubbleScriptCaught in which you declare an array of eight first names. Write a try block in which you prompt the user for an integer and display the name in the requested position. Create a catch block that catches the potential ArrayIndexOfBoundsException thrown when the user enters a number that is out of range. The catch block also should display an error message. Save file as BadSubscriptCaught.java.


a card on which the letter J is written on one side and K on the other. You want to see all of the possible ways the card will land if you drop it n times


Create a program for water sort puzzle in java

The customer should be able to buy items and get a receipts with all details of items bought, remember this is an advanced vending machine hence one can buy more than one items. The printed receipt contains the following details: the item name, quantity, price and total, it should also give a description of the change given out (see below example) Your change is disbursed as follows: N$100 X 1, N$10X1, N$5X1 ,N$1X3,10centsX3 and 5centsX1 4 |PRG510S – Namibia University of Science and Technology Please note the change is linked to the amount of cash in the machine that is if there are no hundreds then the user gets 2 x 50, and that should be recorded to indicate the remaining 50s in the machine has decreased. The same applies to when a customer pays with a 100 then the count for 100s in the machine increases.


The SRC representative on student entertainment and welfare has been informed of your newly acquired knowledge in application development and have approached you to create a stable management system for the vending machine. The system is meant to help the vending machine’s owner in managing its stock and finances, with this in mind your application should then allow for the user to enter a code which is either linked to an item or the pin code used by the owner. If an item code is entered the balance/cost for that item is displayed prompting the user for how many items they what to buy, however if the owner’s pin is entered then an admin menu is displayed. The landing page should give a brief description of the vending machine such as the Name, address and random items in stock and prices


LATEST TUTORIALS
APPROVED BY CLIENTS