Answer:
The procedure in SQL is created as follows
Explanation:
--creating the procedure
CREATE OR REPLACE PROCEDURE prc_inv_amounts (W_IN IN NUMBER)
AS
--defining variables
W_CK NUMBER := 0;
W_SUBT NUMBER := 0;
W_TAX NUMBER := 0;
BEGIN
--Authentication process of the invoice
SELECT COUNT(*) INTO W_CK FROM INVOICE WHERE INV_NUMBER := W_IN;
--Transaction confirmation
IF W_CK = 1 THEN
SELECT SUM(LINE_TOTAL) INTO W_SUBT FROM LINE
WHERE
--checking the invoice for the desired invoice number
LINE.INV_NUMBER = W_IN;
W_TAX :=W_SUBT * 0.08;
--updating the invoice
UPDATE INVOICE
--setting the new values
SET INV_SUBTOTAL = W_SUBT,
INV_TAX = W_TAX,
INV_TOTAL =W_SUBT + W_TAX
WHERE INV_NUMBER = W_IN;
--ending the if statement
END IF;
--ending the procedure
END;
Word processing program is an example of a software. All the others,
such as Printer, Keyboard and Mouse are examples of Computer peripheral
devices or in short hardware devices. Generally these listed hardware
devices come under input or output computer device category. Also, by
classic meaning in layman terms these hardware components can be touched
or felt. In contrast, a word processing program is a part of a computer
system that consists of data or computing instructions and provides the
mechanism to computer to perform a certain task utilizing it's hardware
resources. Such components of computer system which are written using
one of the computer languages are called computer software or software
programs or simply software.
Answer:
import java.awt.Point;
public class Line{
private Point point1, point2;
public Line(Point p1, Point p2){
point1 = p1;
point2 = p2;
}
public Point getP1(){
return point1;
}
public Point getP2(){
return point2;
}
public String toString(){
return "[( The " + point1.x + "," + point1.y + "), (" + point2.x + "," + point2.y +")]";
}
public static void main(String args[]){
Line lineObj = new Line(new Point(7,9), new Point(6,2));
System.out.println(lineObj.toString());
}
}
Explanation:
- Declare the points inside the class Line.
- Initialize the getters and setters method for the class.
- Define a toString method that returns the information in a formatted manner.
- Inside the main method, initialize an object with some values.
- Display the information by calling the toString method.
When the increment or decrement operator is placed before the operand (or to the operand's left), the operator is being used in prefix mode. Postfix mode on the other hand is when the increment or decrement operator is placed after the operand (or to the oper and's right) .
I do it immediately, so it don’t effect my assignments or grades.