Construct a class Rectangle. Provide a constructor to construct a rectangle with a
given width and height, member functions get_perimeter and get_area that compute the
perimeter and area, and overload method to resize the rectangle. For example r*factor
(double factor) resizes the rectangle by multiplying the width and height by the given
factor.
Write a Java program named UseLoanItem that uses an abstract LoanItem class and
Book and DVD subclasses, to display the item type, item name and rental price of
two (2) separate loan items, one (1) of each type. Use constructors, with appropriate
arguments, in each of the classes. Include get and set methods, at least one (1) of
which must be abstract. Also include an abstract Print method in LoanItem that
returns a String for printing. Ensure you include implementation code for the Print
method in each of the subclasses
Write a Java GUI application that will keep track of student results at a local college. The
application must contain the results that a student has obtained for a test, assignment and exam.
Q.3.1 On the form create a list box that will allow the user to select the student ID
populated from the text file. Also create a search button that when clicked will
display the average, highest and lowest result according to the student number.
(5)
Q.3.2 Create a sequential file (student.txt) that contains data for the following fields:
The student ID number;
The student test result; The student assignment result;
The student exam result.
Q.3.2 Load the data from the student.txt file and populate the list box with the student
numbers.
(10)
Q.3.3 Calculate the average result obtained by the student. (8)
Q.3.4 Determine the highest and lowest result that the student obtained from the three
assessments.
Did you know that in lotteries, a 3-digit number with the same numbers in all digits like 777 will hit the jackpot in a casino? In the same manner, let's make a program that will test if a certain 3-digit number hits a jackpot or not by identifying if all the digits of a given number is the same as the second inputted number. If it is, print "Jackpot!"; else, print "Nah".
Let's try this out now!
Create a program that will read the values of A and B. Compare the two values of A & B then print which of the values is higher including the remark "Higher".
Solution in java ONLY plz... FULL question can be found on the following link http://ntci.on.ca/compsci/java/ch5/5_9.html ---> question 12
----------------------------------------------------------------------------------
Write a program that will read an arbitrary number of sets of three integers. The program should prompt the user for sets of numbers and process them until the user submits the numbers 0 0 0. For each set of three numbers, the program should first print the values read. It should then decide whether or not the three numbers could represent the lengths of the sides of a triangle. If the numbers could not represent the lengths of sides of a triangle, an appropriate message should be printed. If they could, then the program should determine and state into which of the above classes the triangle would be placed.
Create a parent class “Account” with three variables num, title and bal with two functions withdraw and deposit. Create a child class “SavingAccount” with a function calculateProfit (that applies 7.5% profit on current balance). Finally create the class “TestApp” that creates the object of Saving account and call withdraw, deposit functions and public data members of Account class. Override withdraw function in SavingAccount to deduct Rs. 250 if the balance after withdrawal of amount is less than 10000.
Create a parent class “Account” with three variables num, title and bal with two functions withdraw and
deposit. Create a child class “SavingAccount” with a function calculateProfit (that applies 7.5% profit on current balance). Finally create the class “TestApp” that creates the object of Saving account and call withdraw, deposit functions and public data members of Account class. Override withdraw function in SavingAccount to deduct Rs. 250 if the balance after withdrawal of amount is less than 10000.
Question 1 (Marks: 50) 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 Deskjesk 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. Marks will be allocated to the presentation and effectiveness of the layout, but the following layout is displayed for your convenience.
Develop a java console banking system and
Implement the following java concept in your solution and highlight in your documentation or code where you did it:
1. Class and Object
2. File and Stream
3. Exception Handling