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.
a. Make provision to handle any kind of unknown ORACLE error using a ORACLE predefined error handler by displaying appropriate message”ORACLE/Unknown error! – call support stuff”
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.
Question 6 [15]
A. Create a function called calc_tax that receives an employee’s salary as a parameter and then returns 15% of that amount as tax. (5)
B. Create a procedure called display_tax that receives a staff number as a parameter, computes the corresponding payable tax by making use of the function created in Question 7A, and then displays information as shown in the sample below. Execute the procedure using any staff number. Show how you would do this. (10)
READY works as a LIBRARIAN, earn R24000 and pays R3600 as
tax
PL/SQL procedure successfully completed.
Question 5 [15]
Create a procedure named subj_info that receives subject code as a parameter and displays information as shown in the sample output below. The procedure makes use of a CURSOR to retrieve and display the required information. Execute the procedure using any subject code.
Show how you would do this.
When you invoke the procedure with SP1 as a subject code, this is the output:
SLEEPY,07-APR-72 registered for SYSTEMS PROGRAMMING 1 on 10-JAN-97
SMUTS,12-JAN-70 registered for SYSTEMS PROGRAMMING 1 on 10-JAN-97
Question 4 [20]
a. Write a PL/SQL block to retrieve registration information and status for a particular student. The student identification number is supplied at run time by the user. The program should display the relevant information, refer to the sample output given below.
Enter value for studentno: 94001111
Petoors WHY (DoB: 03-Dec-1975) a Male student enrol for INTERNAL AUDITING 1
approved by Morgan, I on date unknown
b. Make provision to handle any kind of unknown ORACLE error using a ORACLE predefined error handler by displaying appropriate message”ORACLE/Unknown error! – call support stuff”
c. Using a sample data, 99000278. Display information as in question 5a above. Otherwise, make provision for “invalid or data does not exist error” using ORACLE pre-defined error message “ student 99000278 May not be a registered student”
Question 2 [15]
Write a PL/SQL block to determine whether salaries for members of the staff need to be adjusted or not. Depending on the work load (number of subjects), lectures need to get an increase. Management has decided that whoever teaches 2 or more subjects should get a 15% increase on their salary. Prompt for staff identification number and display this data accordingly. Refer to the sample output
Enter value for staff_number: 513500
Mr/Mrs OLIVIER teaches 2 subjects
ATTENTION: This lecturer is eligible for an increase
The current salary is: R78000 - The new salary is: R89700
Enter value for staff_number: 502501
Mr/Mrs MORGAN teaches 1 subjects
ATTENTION: This lecturer is not eligible for an increase
Question 1 [20]
Write a PL/SQL anonymous block that will prompt the user to enter a particular student number and the displays the student’s registration information. Refer to the sample output below
Enter value for studentno: 97003455
Student: SMUTS, JH
DOB / age: 12-JAN-70(51)
No. of Subject enrolled: 6
Total Fees payable: 7900
Registration date: 10-JAN-97
Enter value for studentno: 94001111
Student: PETOORS, WHY
DOB / age: 03-DEC-75(45)
No. of Subject enrolled: 1
Total Fees payable: 500
Registration date: Date Unknown
Linked List in c++.
1:Write a function to delete a node from end. 2. Write a function to delete a node at given position. 3. Write a function to get the middle the linked list (only use single pointer i.e. head) 4. write a function to move last to nodes of a linked list to the front. Example: 1->2->3->4->5, then the function should change the list to 5->4->1->2->3. 5. Write a function to remove nodes with similar data in a given linked list.
Radioactive decay of radioactive materials can be modeled by the equation 𝐴 = 𝐴0𝑒
−𝑡(ln 2⁄ℎ), where
A is the amount of the material at time t, A0 is the amount at time 0, and h is the half-life.
Technetium-99 is a radioisotope that is used in imaging of the brain. It has a half-life of 6
hours. Your program should display the relative amount A/A0 in a patient body every hour for 24
hours after receiving a dose.
Note: With the aid of formatting techniques documented in your note, ensure your program output
matches that given below