Thursday, 28 November 2019

CS506 Assignment 2 Solution Fall 2019


Please read the following instructions carefully before solving & submitting assignment:

Uploading Instructions:
  • You are not allowed to use any other software/IDE except NetBeans IDE for this assignment development.
  • The submission must be a complete NetBeans IDE project folder (which should contain complete source code, Java files, database file and builds etc.). After finalizing, compress it with Zip or RAR format, save with your own Student ID (e.g. bc000000000.zip) and submit it at VU-LMS within due date.
  • Your assignment should be in .zip /.rar format. Other file formats will not be accepted.
  • No assignment will be accepted through email.

Rules for Marking:
It should be clear that your assignment will not get any credit if:

  • The assignment is submitted after due date.
  • The assignment is not submitted in .zip /.rar format.
  • The submitted assignment does not open or file is corrupted.
  • The assignment is fully or partially copied from other student or ditto copy from handouts or Internet; strict disciplinary action will be taken in this case.
  • The submitted code is unable to compile/execute in NetBeans IDE; during evaluation, submitted code will be checked on NetBeans IDE. If unable to execute then ZERO marks will be awarded and no excuses will be accepted in this regard.

Note: Do not put any query on MDB regarding this assignment, if you have any query then email at cs506@vu.edu.pk
Lectures Covered: This assignment covers Lecture # 1-17

GOOD LUCK



Problem Statement:
You are required to write a Java program, named ShoppingCart, for a typical online shopping system. In which a customer can add and remove items to the shopping cart. The program will calculate the total bill as the items are added/removed to/from shopping cart and will display the amount via user friendly Interface on real time basis. Further, all orders will be saved in a backend database using MS Access so that the administrator could process the orders properly.

Detailed Description:
At start, your program should read Products Data from MS Access database file (sample data is given below) and display a GUI (i.e. Graphical User Interface) which should contain options for selecting quantity of products, sample is given below;
Fig. 1: Shopping Cart GUI

Here, the customer can select the quantity (i.e. 0 to 10) for available products by clicking on add (+) or remove (–) buttons; the cart should be updated on each action and correct amount after calculating the number of items, subtotal, shipping charges (shipping charges are given below) and grand total should be displayed.
When user clicks on "Place Order" then the program should check whether the cart contains any item or not. If cart is empty then a message "Cart is empty!" should be displayed.  Otherwise, order details will be saved to MS Access database file and interface will be updated with initial values (i.e. zero quantity for each item and zero in amount fields etc.) as well.
Further, cross icon at top right corner of the interface should terminate the program and show the developer information (i.e. Student Id and name) via message dialog.

Fig. 2: Developer Info
Required Stuff:
Java Classes:
Product.java
Cart.java
DatabaseHelper.java (should contain all database related code)
MainClass.java (should contain GUI code)

Database file:
BSxxxxxxxx.accdb (must be same as your own VU student id)

Note: need to put database file in assets folder in NetBeans project directory; as shown below;

Fig. 3: Folder "assets" in NetBeans project directory
Sample Data:
#
Item
Price ($)
1
Orange
2.0
2
Grapes
2.5
3
Banana
1.5
4
Mango
3.0

Tab. 1: Sample Products Data

#
No of Items
Charges
1
0
$0
2
1 to 5
$0.5
3
6 to 10
$1.0
4
11 to 15
$1.5
5
16 to 20
$2.0
6
21 to 25
$2.5
7
26 to 30
$3.0
8
31 to 35
$3.5
9
More than 35
$4.0

Tab. 2: Sample Shipping Charges

Tab. 3: Products Table in MS Access Database file
Tab. 4: Orders Table in MS Access Database file
Important Things to Implement:                       
  • For GUI, relevant components (e. JFrame, JPanel, JButton, JTextField and JLable etc.) from AWT and Swing packages should be used.
  • You will have to use ucanaccess driver to connect to MS Access database. In this case, you are suggested to view the following video tutorial.
  • For storing/fetching data to/from database, you will need to use proper SQL queries.
  • You can use same Product and Cart Java classes as provided in assignment # 1 and also can make changes as required.
  • Java classes must have proper Data Members and Member Functions along with Constructors, Standard Setters and Getters etc.
  • Need to make sure that exceptions are managed properly throughout the program; especially NullPointerException, ClassNotFoundException and SQLException.
  • All images, tables and sample data, given in this document, are just for reference purpose only; you have to provide your own implementations. It is not required to be exactly the same.

 Good Luck

Tuesday, 26 November 2019

ENG001 Elementary English Assignment 1 Solution & Discussion Fall 2019

ENG001 ASSIGNMENT NO 1 SOLUTION
Q1. Choose the correct answer from the given options for each of the following. (5*2=10
Marks)
Answer:
1. Which one of the following is an easy way to organize information?
(b) Outlining
2. The word ‘brunch’ belongs to which category of word formation?
(d) Portmanteau
3. Which one of the following serves as a writer’s language tool?
(a) Dictionary
(c) Internet
4. An encyclopedic dictionary contains which type(s) of information?
(c) Geographical and biographical

5. Which one of the following discovery helped to unlock many ancient languages in 1799?
(c) Rosetta Stone


QUESTION NO 2:
Answer:

 ENG001 ASSIGNMENT NO 1 SOLUTION
Q1. Choose the correct answer from the given options for each of the following. (5*2=10
Marks)
Answer:
1. Which one of the following is an easy way to organize information?
(b) Outlining
2. The word ‘brunch’ belongs to which category of word formation?
(d) Portmanteau
3. Which one of the following serves as a writer’s language tool?
(a) Dictionary
(c) Internet
4. An encyclopedic dictionary contains which type(s) of information?
(c) Geographical and biographical

5. Which one of the following discovery helped to unlock many ancient languages in 1799?
(c) Rosetta Stone





QUESTION NO 2:
Answer:



Solution File
ACC501_MIDallmcqs.doc ENG001-ASSIGNMENT-1-Solution-Fall-19_whichquery.com_.docx

Monday, 25 November 2019

cs 401 Assignment no.2 Solution Fall 2019



Question No 1
[org0*0100]
Mov ax, 1
Mov bx, 0
Mov cx, 0
Number: dw 0
        Jmp start
Factnol:
f-loop: mul word [number]
sub word[number], 1
cmp word[number], 2
jge f-loop
ret
start:
clc
mov cx, [ID+bx]
mov [number],  cx
add bx, 2
shr cx, 1
call factnol
Mov ax, 0*4c00
int 0*21
ID: bc 1,7,0,4,0,6,4,8,6   write your id here

Question No 2 Solution:
[org 0*0100]
Number 1:   dw 1
Number 2:   dw 2
Large:     dw 0
Mov ax, [number1]
Mov ax, [number2]
cmp ax , bx
Mov[large], bx
Jmp the end
Next:
         Mov [large], ax
The end:
Mov ax , 0*4c00
Int 0*21

cs402 assignment 2 Due Date:02 Dec, 2019


Assignment No. 02
Semester: Fall 2019
Theory of Automata – CS402

Total Marks: 20

Due Date:02 Dec, 2019

Objectives:
Objective of this assignment is to assess the understanding of students aboutthe concept of languages, regular expressions and finite automata and GTG.

Instructions
:
Please read the following instructions carefully before submitting assignment:
  1. You should consult the recommended books, PowerPoint slides and audio lectures to clarify your concepts.
  2. You are supposed to submit your assignment in .doc format. Any other formats like scan images, PDF, zip, rar and bmp etc will not be accepted.
  3. It should be clear that your assignment will not get any credit if:
·         The assignment is submitted after due date.
·         The assignment is copied from Internet or from any other student.
·         The submitted assignment does not open or file is corrupt.

Note: No assignment will be accepted after the due date through email in any case (load shedding, server down, internet malfunctioning etc.).
It is recommended to upload solution file at least two days before its closing date.

For any query about the assignment, contact atcs402@vu.edu.pk

Question No 1:            Marks=10Q1: Derive the regular Expressions (RE) for the following DFA. You are required to mention all the required steps.


Question No 2:                          Marks=10
Q2: Derive the regular Expressions (RE) for the followingDFA. You are required to mention all the required steps.

Note: Providing direct solution without step by step process will be not be accepted for both the questions.  

BEST OF LUCK