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 an even sized String and prints out the first half concatenated with

original string separated by a single space.

Sample run 1:

Enter a single string: HelloThere

Output: Hello Hello There


Java considers the String data type as non-primitive, because it contains a sequence of characters and hence there is a predefined class called String dedicated to String processing. The String class has a lot of functions and continues to grow. See https://www.tutorialspoint.com/java/java_strings.htm for more on strings. Your task is to then create a java program that when give a sentence will replace the first occurrence of NUST with Namibia University of Science and Technology.

Sample run 1: Enter a sentence: Welcome to my NUST.

Output: Welcome to my Namibia University of Science and Technology.

Sample run 2: Enter a sentence: The nust is a great institution of high learning.

Output: The Namibia University of Science and Technology is a great institution of high learning.


Given three numbers from user input, decrement the first number by 1 and increment the third number by 2, Then do the magic calculations as follows: get the sum of the first two numbers, deduct the third number from the second and get the product of the first and third number, then sum up the results of the three magic calculations and finally divide you outcome by 3. Sample run 1:

Enter three numbers separated by spaces: 4 2 3

Output: Result of Magic calculations = 5

Sample run 2: Enter three numbers separated by spaces: 2 8 5

Output: Result of Magic calculations = 5

a) Write an Pseudocode to solve the above problem

b) Create a flowchart for the above pseudocode

c) With the help of both your Pseudocode and Flowchart, create a Java program that solves the program as per the given sample out puts and problem description


1. In your solution, you must create a class called Products, which will contain all your working
methods.
2. This class will, as a minimum, contain the following methods, but you are encouraged to
add more methods:
• SearchProduct();
• SaveProduct();
• UpdateProduct();
• DeleteProduct();
• DisplayMenu();
• CaptureProduct();
• ExitApplication();
3. Finally, create a main class to run your application
1. In your solution, you must create a class called Products, which will contain all your working
methods.
2. This class will, as a minimum, contain the following methods, but you are encouraged to
add more methods:
• SearchProduct();
• SaveProduct();
• UpdateProduct();
• DeleteProduct();
• DisplayMenu();
• CaptureProduct();
• ExitApplication();
3. Finally, create a main class to run your application

1 When the user selects to view a report, display the product report generated from the arrays in your application. You must create a class called ReportData which will contain get and set methods for each item required in the report


Write a program that displays the following two tables side by side (note that 1 ping = 3.305 square meters):
Ping
Square meter
|
Square meter
Ping
10
33.050
|
30
9.077
15
49.575
|
35
10.590
...
75
247.875
|
95
28.744
80
264.400
|
100
30.257
The roots of the quadratic equation ax2 + bx + c = 0, a
How cold is it outside? The temperature alone is not enough to provide the answer. Other factors including wind speed, relative
humidity, and sunshine play important roles in determining coldness outside. In 2001, the National Weather Service (NWS)
implemented the new wind-chill temperature to measure the coldness using temperature and wind speed. The formula is
twc = 35.74 + 0.6215ta - 35.75v0.16 + 0.4275tav
0.16
where ta is the outside temperature measured in degrees Fahrenheit and v is the speed measured in miles per hour. twc is the
wind-chill temperature. The formula cannot be used for wind speeds below 2 mph or temperatures below -58

Create a graphical user interface (GUI) program that will perform basic standard 

calculator operations. The students will not be penalized for having extra arithmetic operations 

in their program.


LATEST TUTORIALS
APPROVED BY CLIENTS