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 GUI application that will keep track of a company's products. The application must contain the product id, product name and the product price.


On the form, create three text fields t capture the product details and a non editable text area to display the product details. Create a submit button that when clicked will save the product details to a products.txt file. Also include a search button that will allow a user to search for a product based on the product Id.


Create a sequential file (products.txt) that contains data for the following fields:


The product Id, The product name and price


Load the product details from the products.txt file. Populate the text area form load and whenever the new product us saved.


When the search button is clicked, promt the user with an Input box to enter in the product id. Based on the product id, display the name and product price.


Develop a Java GUI application that will display the ink cartridge usage of three different printers with a time span of three years.


Q.1.1 On the form, create two combo boxes, to allow a user to select between three different printers and years. When a user has selected a printer and year and clicked the submit button, display the amount of ink cartridges used for that year. Use the following table for the printers and yearly cartridges used: 2018 2019 2020 HP Deskjet 650 10 35 20 Epson K750 15 22 12 Canon Z100 30 31 33


Q.1.2 You are also required to create a menu system which will allow the user to exit the application under the file menu. Under the tool’s menu, allow the form submission and an option to display the yearly ink cartridges used for each printer. The layout of the form is left to your discretion.


Q.1.3 The application must display a report of each printer and the total ink cartridge used for the three different years.


On the form, create a list box that will allow the user to select a contact name, which is populated from a text file. Also create a search button that when clicked will display the mobile number, work number and email address.


Create a sequential file (contacts.txt) that contains data for the following fields:

The contact name;

The contact mobile number;

The contact work number;

The contact email address.


Load the data from the contacts.txt file and populate the list box with the contact names. Include a feature to inform the user on the amount of contacts.


1. Consider the following program, what is the output? (5 marks)

class overload

{

int x;

double y;

void add(int a , int b)

{ x = a + b; }

void add(double c , double d)

{ y = c + d; } overload()

{ this.x = 0;

this.y = 0;

}

} class Overload_methods

{ public static void main(String args[])

{

overload obj = new overload();

int a = 2; double b = 3.2;

obj.add(a, a);

obj.add(b, b);

System.out.println(obj.x + " " + obj.y); 


Groupings


by CodeChum Admin



Did you know that you can also reverse lists and group them according to your liking with proper code? Let's try it to believe it.





Instructions:



Create a variable that accepts a positive odd integer.


Create an empty list. Then, using loops, add random integer values into the list one by one. The number of values to be stored is dependent on the inputted odd integer on the first instruction.


Reverse the order of the list. Then, print out the list's new order in this manner:


[first-half values]-[middle value]-[second-half values], just like that of the sample output. Make use of list slicing that you’ve learned from the past lessons to easily achieve this segment.


Input



The first line contains an odd positive integer.


The next lines contains an integer.



5


1


3


4


5


2


Output



A line containing a list.



[2,5]-[4]-[3,1]

The GCD


by CodeChum Admin



The greatest common divisor, also known as GCD, is the greatest number that will, without a remainder, fully divide a pair of integers.





Now, I want you to make a program that will accept two integers and with the use of loops, print out their GCD. Make good use of conditional statements as well.



Off you go!



Input



A line containing two integers separated by a space.



6·9


Output



A line containing an integer.



3

Arraying 102


by CodeChum Admin



We've already made arraying/listing the easy way, but how about arraying/listing and printing the list in reverse order?





Make a program that will input an integer and then using loops, add items on an array/list one by one for the same number of times as that of the first inputted integer. Then, print out the array/list in reverse order, that is, starting from the last item on the array/list down to the first one, each in separated lines.



Input



The first line contains the size of the array/list.


The next lines contains the items of the array/list (integers).



5


1


64


32


2


11


Output



Multiple lines containing integers.



11


2


32


64


1

write a java display this output :

output format display:

student Name: Florence Cheng

Student id:10010005

Study mode: Part time


programme:

higher diploma in Computer Technology

Cerrent Level: Year 1


Number of modules take by the term : 4


Code Attendance Exam Mark Grade

cs101 100% 80 HD

cs102 69% 71 D


the module details please use Arraylist Record .

the student id of 8 digit and starts with 1001

the student name length maximum is 25 characters with space inclusive

the study mode could be " Full time "or "Part time"

the name of programmes could be selected form the list as shown in table below

the current level could be 1 and 2.1 (means year 1 and 2 means years 2)

the code could be selected form the list as shown in table below






 Big-Sightedness

by CodeChum Admin

I got my grandmother a new phone because I thought that we could talk more everyday by texting. Well, let’s just say that my grandma’s eyes aren’t the best anymore so she can’t really see what I text her and because of that she wants to ditch texting and stick with carrier pigeons. You know how embarrassing it is for a kid like me to be seen using carrier pigeons?!?! Well, anyway, I was hoping that you could make a program that takes my text and make it bigger, a LOT bigger. How about you test it out by only using the letters A, B, and C first.


Input


1. My text


Description

This is a string with characters A, B, and C.

Constraints

It is guaranteed that all letters are in uppercase.

Output

The first line will contain a message prompt to input my text.

The succeeding lines will contain the enlarged text.

Enter·my·text:·ABC

***·**··***
*·*·*·*·*
***·**··*
*·*·*·*·*
*·*·**··***

The GCD


by CodeChum Admin



The greatest common divisor, also known as GCD, is the greatest number that will, without a remainder, fully divide a pair of integers.





Now, I want you to make a program that will accept two integers and with the use of loops, print out their GCD. Make good use of conditional statements as well.



Off you go!



Input



A line containing two integers separated by a space.



6·9


Output



A line containing an integer.



3

LATEST TUTORIALS
APPROVED BY CLIENTS