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

Create a program that takes in two words, check for equality ignoring the cases, if the words are
equal the print the word in upper case with an appropriate message however if the words are
different then print the two words in lower case with an appropriate message.
Sample run 1:
Enter two words separated by spaces: Welcome WELCOME
Output: You have only entered one word: “WELCOME”
Sample run 2:
Enter two words separated by spaces: NUST Students
Output: You have entered two words: “nust” and “students”

Write a java programme named Adding Numbers.java that uses a method to sum all the integers from 10 to 20 but skipping 15 and 16. Invoke the method within the print command line to print The sum of all integers from 10 to 20 excluding 15 and 16 is 134.


Supposing you are operating a warehouse that receives and issues out items daily, and at the end of each day, you take stock of the transactions. Answer the following based on your knowledge in Java Programming.


a) Provide a suitable name for your warehouse. b) Suggest the type of item you are dealing with and the cost of each item (e.g. bags of cement at 50 cedis per bag).


c) Write a Java programme named transactions java that takes input from you in the form of: positive integers representing the number of items brought in each time, and negative integers representing the number of items issued out each time. The programme will then calculate and print out the total number of items received and issued out, as well as their corresponding total costs. Your programme ends when the input is zero (0).





Create a program that takes in a student’s full names and marks for 3 In-class exercises, then calculate the average of this marks. This average mark is then categorized as follows: Marks obtained Grade Level Message 80 – 100 1 Magnificent!! 70 – 79 2 Excellent!! 60 – 69 3 Good work!! 50 – 59 4 Good!! 2 DUE DATE: MONDAY 06 OCTOBER 2021 BEFORE 23h59 0 – 49 0 Fail – Try again next Year!! Greater than 100 or less than 0 X Invalid Marks!!, Marks too high. Or Invalid Marks!!, Negative marks not allowed.

Sample run 1:

Enter student full names: Goodluck Johnathan

Enter 3 marks separated by spaces: 78 94.6 88

Output: Student name: Goodluck Johnathan

Grade Level: 1

Comment: Magnificent!!


Sample run 2:

Enter student full names: Ellen Johnson Sirleaf

Enter 3 marks separated by spaces: 200 104.87 99.9

Output: Student name: Ellen Johnson Sirleaf

Grade Level: X

Comment: Invalid Marks!!, Marks too high.


Design prototype for Hotel App.

Write a Java program, should be well commented. Should include purpose,author; comments describing each variable and comments on each section.


App should contain. Last name, First name, Middle name, Street Name, Street Type, City, Age.


Above information displayed to the user in formart: Initial of first name (full stop), Initial of middle name (full stop), last name appear in one line.


Display in one line: House number, Street name, Street type

Display in one: City


Age Brackets : Line by itself

20 or under

21-35

36-70

71 or over


1)Create an abstract class DiscountPolicy. It should have a single abstract method calculateDiscount that will return the discount for the purchase of a given number of a single item. The method has two parameters, count and itemCost.

2)Derive a class BulkDiscount from DiscountPolicy. It should have a constructor that has two parameters, minimum and percent. It should define the method calculateDiscount so that if the quantity purchased of an item is more than minimum, the discount is percent percent.


Develop a DiscountPolicyTest class to verify generated discount is followed policies or not.


Write a java application using the concepts of multithreading for a flower
shop where flowers are delivered based on order.
Write a program in Java to perform the following operations on Matrix using
multithreading. Get the required input matrix from the user and after that run
three threads to perform the following operation.
a. Addition
b. Subtraction
c. Multiplication

Program to learn different types of inheritance in java.


Create a program that when run with a name, an integer and a double as CMD arguments, it prints out a greeting using the name and also print the difference of the two given numbers:

Sample run 1:               

java Lab01_task85 John 25 18.65

Output: Good day John.

The difference between 25 and 18.650 = 6.35


LATEST TUTORIALS
APPROVED BY CLIENTS