CS403 ASSIGNMENT NO 3 SOLUTION SPRING 2019
you are required to enter your id in database name if you didn’t enter your id your marks will be zero. Just replace the Enteryouridhere with your Virtual university id i.e (mc111111111)
Q1:
Query for CreatingDatebase:
CREATE DATABASE Enteryouridhere
Screenshot of Query Execution:
Q2:
Query forCreatRoleTable;
CREATE TABLE Role ( Role_idvarchar(255) NOT NULL PRIMARY KEY, Name varchar(255))
Screenshot of Query Execution:
Query toCreatUserTable;
CREATE TABLE Users ( User_idvarchar(255) NOT NULL PRIMARY KEY, Name varchar(255),Role_idvarchar(255) FOREIGN KEY REFERENCES Role(Role_ID))
CREATE TABLE DiscussionThread(Thread_idvarchar(255) NOT NULL PRIMARY KEY, Task_idvarchar(255) FOREIGN KEY REFERENCES Task(Task_id), titlevarchar(255) )
Screenshot of Query Execution:
Query toCreat Message Table;
CREATE TABLE Messages(Msg_idvarchar(255) NOT NULL PRIMARY KEY, Tread_idvarchar(255) FOREIGN KEY REFERENCES DiscussionThread(Thread_id), message_body text, sender_idvarchar(255) )
Screenshot of Query Execution:
Q3: After creation of tables in database you are required to add the following records into the Taskand DiscussionThreadtables by writing the appropriate SQL Query.
Query for Adding Data into Task Table;
INSERT INTO Task (Task_id, title,creation_date,dead_line,assign_to)
VALUES ('T0001','Computer Science','2019/01/01','2019/01/15','1');
INSERT INTO Task (Task_id, title,creation_date,dead_line,assign_to)
VALUES ('T0002','Management Science','2019/02/02','2019/02/16','2');
INSERT INTO Task (Task_id, title,creation_date,dead_line,assign_to)
VALUES ('T0003','Mass Communication','2019/03/03','2019/03/17','3');
INSERT INTO Task (Task_id, title,creation_date,dead_line,assign_to)
VALUES ('T0004','Bio Informatics','2019/04/04','2019/04/20','4');
Screenshot of Query Execution:
Query for Add Data into DisscussionThread Table:
INSERT INTO DiscussionThread (Thread_id,Task_id,title)
VALUES ('Th001','T0001','BSCS');
INSERT INTO DiscussionThread (Thread_id,Task_id,title)
VALUES ('Th002','T0002','BBA');
INSERT INTO DiscussionThread (Thread_id,Task_id,title)
VALUES ('Th003','T0003','MSC zoology');
Screenshot of Query Execution:
Q4:query for retrieving a record from the Task table whoseTask_id is T0003.
Query to Select Data From Task Table:
SELECT * FROM Task WHERE Task_id='T0003'
Screenshot of Query Execution:
Q5:Alter the table of the DiscussionThread and include the “Status” column in the DiscussionThread table.
Query to Alter DisscussionThread Table;
ALTER TABLE DiscussionThread
ADD Status varchar(100);
Screenshot of Query Execution:
Please read all the instructions carefully before attempting the assignment.
You are required to create a WPFC# applicationusing Visual Studio.
Problem Statement:
First Design interface in WPF as given in the gif file, the application will let the user browse an image and after the image shows up user can zoom in and zoom out the picture in a separate dock panel with seek bar mouse movement.
GUI:
Layouts:
Parent Layoutis DockPanel , inside DockPanel there are 2image Views with one image of original and other zoomed imageand a Stackpanel which is docked at the bottom.
1 Button and seek bar is inside StackPanel
Image View: Image View will be used to set image recourse that will be browsed with button.
Browse button will be used to browse and JPG Image file and set that image to Image View.
Seek Bar(+ (Zoom in),- (Zoom out)) +will be used to zoom in the opened picture- will be used to zoom out the picture. When seek bar value reached at 50% it will change its back ground color of seek bar from green to blue.
Your ID: Instead of “mainWindow” there should be your own VU id i.e. bc123456789
Output.gifhas been attached with this Assignment file please observe this file carefully your program’s output must be like this output file.
Submission details
Following Files Must be submitted in a single zip or rar file.
· .CS code file
· .XAML File (Front End file)
· A .gif file which shows working of your Application(For Recording .gif a software named Screentogif is uploaded on LMS, or you can use any other gif recording tool as well)
You are not required to submit the complete project, only copy these three files from project folder. Please note if you submit doc or txt file you will be awarded 0 marks. Make sure to write your own VU ID in the assignment file(s) otherwise assignment will not be accepted.
If you do not submit any of the above mentioned file 25% marks per file will be deducted.
The second parameter of the getCurrentPosition() method is used to handle errors. It specifies a function to run if it fails to get the user's location:
x.innerHTML = "User denied the request for Geolocation."
break;
case error.POSITION_UNAVAILABLE:
x.innerHTML = "Location information is unavailable."
break;
case error.TIMEOUT:
x.innerHTML = "The request to get user location timed out."
break;
case error.UNKNOWN_ERROR:
x.innerHTML = "An unknown error occurred."
break;
}
}
</script>
</body>
</html>
OUTPUT
Click the button to get your coordinates.
Location-specific Information
This page has demonstrated how to show a user's position on a map.
Geolocation is also very useful for location-specific information, like:
Up-to-date local information
Showing Points-of-interest near the user
Turn-by-turn navigation (GPS)
The getCurrentPosition() Method - Return Data
The getCurrentPosition() method returns an object on success. The latitude, longitude and accuracy properties are always returned. The other properties are returned if available:
Property
Returns
coords.latitude
The latitude as a decimal number (always returned)
coords.longitude
The longitude as a decimal number (always returned)
coords.accuracy
The accuracy of position (always returned)
coords.altitude
The altitude in meters above the mean sea level (returned if available)
coords.altitudeAccuracy
The altitude accuracy of position (returned if available)
coords.heading
The heading as degrees clockwise from North (returned if available)
coords.speed
The speed in meters per second (returned if available)
timestamp
The date/time of the response (returned if available)
Geolocation Object - Other interesting Methods
The Geolocation object also has other interesting methods:
watchPosition() - Returns the current position of the user and continues to return updated position as the user moves (like the GPS in a car).
clearWatch() - Stops the watchPosition() method.
The example below shows the watchPosition() method. You need an accurate GPS device to test this (like smartphone):