Create a Java program named PE2Lastname. (ex. PE2Dela_Cruz)
Construct a simple purchasing program based on the UML Class Diagram below.
The (-) symbol represents private variables, while(+) represent public.
PE2Lastname
-itemName: String
-itemPrice:double
-itemQuantity:int
-amountDue:double
+setItemName(String newItemName): void
+setTotalCost(int quantity, double price): void
+getItemName(): String
getTotalCost(): double
+readInput(): void
+writeOutput():void
Note: The readInput() method will be used to accept user input through the Scanner
class. This is done by doing the following:
a.
Importing Scanner from the java.util package.
b.
Instantiating an object of the Scanner class, Scanner s = new
Scanner(System.in);
c.
Storing the input to the variable name based on data type:
a.
For String: s.nextLine()
b.
For int: s.nextInt()
c.
For double: s.nextDouble()
d.
Write a C program using two dimensional arrays that determine the even numbers among the twelve input values from the keyboard and prints the list of these even numbers
c) The Rectangle class contains:
• Two instance variables width (double) and length (double).
• Three constructors as shown. The no-arg constructor initializes the width and length to 1.0.
• Getter and setter for all the instance variables.
• Methods getArea() and getPerimeter().
• Override the inherited toString() method, to return "A Rectangle with width=xxx and length=zzz, which is a subclass of yyy", where yyy is the output of the toString() method from the superclass.
Write PL/SQL block to create a trigger to update the records according to working days that is you can not update record in holidays
Given a linked list of N nodes. The task is to reverse the list by changing links between nodes (i.e if the list is 1->2->3->4 then it becomes 1<-2<-3<-4) and return the head of the modified list.
Input
User Task:
Since this will be a functional problem, you don't have to take input. You just have to complete the function ReverseLinkedList that takes head node as parameter.
Constraints:
1 <=N <= 1000
1 <= Node.data<= 100
Output
Return the head of the modified linked list.
Given a singly linked list and an element K, your task is to insert the element at the tail of the linked list.
Input
User Task:
Since this will be a functional problem, you don't have to take input. You just have to complete the function addElement() that takes head node and the integer K as a parameter.
Constraints:
1 <=N<= 1000
1 <=K, value<= 1000
Output
Return the head of the modified linked list
You are given a Singly linked list and an integer K. Your task is to insert the integer K at the head of the given linked list
Input
User Task:
Since this will be a functional problem, you don't have to take input. You just have to complete the function addElement() that takes head node and the element K as a parameter.
Constraints:
1 <=N<= 1000
1 <=K, value<= 1000
Output
Return the head of the modified linked list
Explain various types of logical operators used in C language with examples.
Write a program in C that display even numbers between 50 and 250 using do while loop.
Discuss switch case statement in C language programming language by taking a suitable example