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 simulation program for the fruit market. The farmer will be able to
produce different types of fruits (apple, orange, grape, and watermelon), and
put them in the market to sell. The market has limited capacity and farmers
have to stand in a queue if the capacity is exceeded to sell their fruits.
Consumers can come to the market any time and purchase their desired fruits;
and if the fruits they want to buy runs out, they are willing to wait until the
supply of that kind is ready. (Hint: implementing this market will encounter
the producer and consumer problem, and it probably needs multiple buffers
for different kinds of fruits).

1a.Write a program to input 10 integer numbers into an array named fmax and determine the maximum value entered. Your program should contain only one loop and the maximum should be determined as array element values are being input. (Hint: Set the maximum equal to the first array element, which should be input before the loop used to input the remaining array values.)

b. Repeat 1a, keeping track both the maximum element in the array and the index number for the maximum. After displaying the numbers, print these two messages


The maximum value is: _______

This is element number _______ in the list of numbers.

Have your program display the correct values in place in the underlines in the messages.

c. Repeat 1b, but have your program locate the minimum of the data entered.


Given any whole number from user input, check whether it’s a positive or negative number. If the number is negative then increment it by 3 and multiply the result by 4, however if it’s a positive number then decrement by 4 and multiply it by 3. a) Create a flowchart to be followed to solve the above task b) Create a java program using your flowchart.


Write a menu driven program in Java to perform the operations on an Integer
Queue by making use of the concept of interfaces. And create custom
exceptions to deal with the following situations
A non-integer value is encountered in the queue
b. Insert operation when the Queue if full
c. Remove operation when queue is empty.

Which of the language listed below is not a High-level programming language?

Select one:

a.

MASM

b.

C#

c.

Python

d.

Ruby


  1. To qualify for a loan award, a student should score between 25 -100 points and should have been admitted to an accredited institution.  Write a program that accept points, institution and their gender(f for female and m for male) separated by spaces and determine if the student qualifies for an award or not. The program should also, print their gender in full and capitalized

 

NOTE: String processing methods of String class should be used where necessary!! 

Institution Name 

Accreditation 

 NUST 

Yes 

UNAM 

Yes 

Space Institute 

No 

 

Sample run1:  

Enter points and institution: 60 NUST F  

Output: Loan Award Successful and application gender is: FEMALE

 

  1. Defining diagram 
  2. Pseudocode 
  3. Flowchart 
  4. Java program  

Write a program that calculate and displays an employee’s weekly salary. If the hours worked are less or equal to 40, the employee is payed N$65.54 per hour, otherwise the employee receives N$80.20 for every hour worked exceeding 40.  


Draw a flowchart that uses while loops to perform the following steps:

a. Prompt the user to input two integers: firstNum and secondNum. (firstNum must be less than secondNum.)

b. Output all the odd numbers between firstNum and secondNum inclusive.

c. Output the sum of all the even numbers between firstNum and secondNum inclusive.

d. Output all the numbers and their squares between 1 and 10.

e. Output the sum of the squares of all the odd numbers between firstNum and secondNum inclusive.



Write a pseudocode that calculates and prints the bill for a cellular telephone company. The company offers two types of service: regular and premium. Rates vary based on the type of service and are computed as follows:



Regular service: $10.00 plus first 50 minutes are free. Charges for over 50 minutes are $0.20 per minute.

Premium service: $25.00 plus:

a. For calls made from 6:00 a.m. to 6:00 p.m., the first 75 minutes are free; charges for over 75 minutes are $0.10 per minute.

b. For calls made from 6:00 p.m. to 6:00 a.m., the first 100 minutes are free; charges for over 100 minutes are $0.05 per minute.
Write a Java program to display the three highest monthly speeding fines recorded for four
different cities. The following rows and columns represent the monthly speeding fines of each
city.
JAN FEB MAR
JHB 128km 135km 139km
DBN 155km 129km 175km
CTN 129km 130km 185km
PE 195km 155km 221km
Using a Two Dimensional array, produce the speeding fines report including the speeding fines
statistics. The speeding fines statistics must display the highest and lowest speeding fines in the
two dimensional array.
LATEST TUTORIALS
APPROVED BY CLIENTS