The formula used to calculate the density of a substance is mass divided by volume. It is expressed as d = m/v. Ask users for the mass and volume of a substance and calculate the density for them.
Output:
Enter the mass of a substance in grams (integers only): [assume user inputs 10]
Enter the volume of a substance in milliliters (integers only): [assume user inputs 4]
The density of your substance is 2.5
Write a comparison report of the JArchitect and McCabe IQ tool. Your report must cover the following: 1. Snapshot of Installation process 2. Features of both JArchitect and McCabe IQ tool 3. Run the same source code on both JArchitect and McCabe IQ tool. 4. Conclusion
A school maintains academic record of its students (of a class) in different arrays. The information stored is:
1. Roll Number (in an integer array)
2. Midterm Marks (in a float array)
3. Final Marks (in a float array)
4. Class of a student e.g. Class 1, Class 2, Class 3 (in an integer array)
5. The Grades based on final marks (in char array)
a. Final Marks less than 50 – F
b. Final Marks: 50 to 59 (both inclusive) – D
c. Final Marks: 60 to 72 (both inclusive) – C
d. Final Marks: 73 to 85 (both inclusive) – B
e. Final Marks: 86 and above – A
This program can display data from the existing student record. At the start of program, a menu will be displayed. The program will continue to work until e or E is entered. Error message will be displayed if any number (or a character) other than the given option is entered. Each array must have a size 100 and for the sake of my convenience, the arrays should be populated with exactly 50 student entries. The roll numbers must be unique – you have to take care of this.
The main menu must be the following (the comments written in the menu below are for your understanding and SHOULD not be displayed as such):
1. Sort and display all the records roll number wise in ascending order. /*When this option is selected, the output should be:
Roll No: 25 Midterm Marks: 10.5 Final Marks: 55 Class: 6 Grade: D
Roll No: 45 Midterm Marks: 8 Final Marks: 55 Class: 7 Grade: D
Roll No: 66 Midterm Marks: 36 Final Marks: 75.5 Class: 6 Grade: B
. . . .
.
. . . .
.
. . . . outputs for options 2-8 must be similar to option 1/*
.
2. Sort and display all the records roll number wise in descending order.
3. Sort and display all records in ascending order based on marks in Midterm
4. Sort and display all records in descending order based on marks in Midterm
5. Sort and display all records in ascending order based on marks in Final
6. Sort and display all records in descending order based on marks in Final
7. Sort and display all records in ascending order based on Grade 8. Sort and display all records in descending order based on Grade 9. Add a new entry of a student.
/*Assuming that the arrays got sorted after option 1 was selected, the new student entry which got added is shown below. Addition must be done on the next available index. You must ensure that the arrays are not full. In this option you will also make sure that the roll number that is being entered in unique:
10. Delete a student record based on his roll number.
/*In this option, the user will enter a roll number and the whole data related to it must be deleted. The entries must be shifted so that there is no space in between any entry. Assuming that the user enters 66, the arrays after deletion are shown below:
11. Display record of all the students greater than X marks in final exam (in descending order with respect to marks obtained in final exam). The value of X will be entered by the user.
12. Display record of all the students greater than X marks in final exam (in ascending order with respect to marks obtained in final exam). The value of X will be entered by the user.
13. Display record of all the students less than or equal to X marks in final exam (in descending order with respect to marks obtained in final exam). The value of X will be entered by the user.
14. Display record of all the students less than or equal to X marks in final exam (in ascending order with respect to marks obtained in final exam). The value of X will be entered by the user.
15. Display record of all the students greater than X grade (in descending order with respect to grade). The value of X (character) will be entered by the user.
16. Display record of all the students greater than X grade (in ascending order with respect to grade). The value of X (character) will be entered by the user.
17. Display record of all the students less than or equal to X grade (in descending order with respect to grade). The value of X (character) will be entered by the user.
18. Display record of all the students less than or equal to X grade (in ascending order with respect to grade). The value of X (character) will be entered by the user.
a) Create a data sheet in MS Access which includes Employee ID, Employee Name, Father Name, Gender (Male, Female), Age, Date of Joining (dd-mm-yyyy), Address, Cell number (0300-0000000) and City (Karachi, Islamabad, Lahore).
b) Also create its Form and add at least 2 record through the form and create the following queries:
· List only those employees who belong to the city Karachi.
· Show only the female employee in the employee table
There should be at least 12 to 15 record in the table.
Please reply as fast as possible
III. Query questions. (COVERING 12 ITEM, 67 marks IN TOTAL)
Table:Movies
Id Title Director Year Length_minutes
1 Toy Story John Lasseter 1995 81
2 A Bug's Life John 1998 95
3 Toy Story 2 John Lasseter 1999 93
4 Monsters, Inc. Pete Docter 2001 92
5 Finding Nemo Andrew Stanto 2003 107
7 Cars John Lasseter 2006 117
9 WALL-E Andrew Stanton 2008 104
10 Up Pete Docter 2009 101
11 Toy Story 3 Lee Unkrich 2010 103
12 Cars 2 John Lasseter 2011 120
13 Brave Brenda Chapman 2012 102
87 WALL-G Brenda Chapman 2042 97
Table: Boxoffice
Movie_id Rating Domestic_sales International_sales
5 8.2 380843261 555900000
12 6.4 191452396 368400000
3 7.9 245852179 239163000
9 8.5 223808164 297503696
11 8.4 415004880 648167031
1 8.3 191796233 170162503
7 7.2 244082982 217900167
10 8.3 293004164 438338580
4 8.1 289916256 272900000
2 7.2 162798565 200600000
13 7.2 237283207 301700000
1. Create the table Movies. It includes the domain of values associated with each attribute and integrity constraints. (7 marks)
2. Write an SQL query that finds the title of each film.(5 marks)
3. Write an SQL query that finds the movies released in the years between 2000 and 2010 . (5 marks)
4. Find all the WALL-* movies. (5 marks)
5. List the last four Pixar movies released (ordered from most recent to least). (5 marks)
6. Find the domestic and international sales for each movie. (6 marks)
7. List all movies that were released on even number years. (5 marks)
8. Add the studio's new production, Toy Story 4 to the list of movies (you can use any director). (5 marks)
9. The director for A Bug's Life is incorrect, it was actually directed by John Lasseter. (5 marks)
10. This database is getting too big, lets remove all movies that were released before 2005. (5 marks)
11. SELECT title, year FROM movies WHERE year < 2000 OR year > 2010; (6 marks)
Write the result:
1. The relationship among Database(DB), Database System(DBS) and Database Management System(DBMS) is ______.
A. DBMS includes DB and DBS B.DBS includes DB and DBMS
C. DB includes DBS and DBMS D.DB is DBS, also as DBMS
2. In database fields, we refer SQL as _______.
A. Standard Query Language B. Structured Query Language
C. System Query Language D. Sequence Query Language
3. Choose the proper choice to make the following query to realize:
Find the names of all customers whose street includes the substring “Main”.
select customer_name
from customer
where customer_street ________
A. like ‘Main\%’ B. like ‘_Main_’
C. like ‘%Main%’ D. like ‘\Main_’
4. Choose the only one INCORRECT description from the followings: _____
A. Neither tuples nor attributes have order.
B. Attributes can appear in any order and the relation is still the same.
C. Each value in the database must be a member of some domain.
D. Duplicate tuples can exist in a relation.
II. Briefly description questions. (Write your answers onto the answer sheet.) (24 marks)
1. What are key constraints and foreign constraints?
2. Please briefly list FOUR duties of a database administrator.
3. Explain LEFT JOIN, OUTER JOIN and INNER JOIN.
To get the average of a series of values, you add the values up and then divide the total by the number of values.
Write a program that stores the following values in seven different variables: 14, 32, 104, 63, 89, 125, 213.
The program should first calculate the total of these seven variables and store the result in a separate variable named total.
Then, the program should divide the total variable by seven to get the average. Display the average on the screen.
Question No. 2 [10 Marks]
Create a New MVC Web application. Create a New Database in App_Data Folder WPLTASKDB. Create Four Table in your Database
Student -> StudentID (PK), Name, ClassID(FK), CampusID(FK)
Teacher -> TeacherID (PK), TeacherName, ClassID (FK), Qualification
Campus -> CampusID (PK), CampusName
Class -> ClassID(PK), ClassName
Create Four Controller in your Website, by using StudentController your Application should be able to Add, Update, Delete and View All Students, by using TeacherController your Application should be able to Add, Update, Delete and View All Teachers, by using CampusController your Application should be
able to Add, Update, Delete and View All Campus, by using ClassController your Application should be able to Add, Update, Delete and View All Classes.
The Home Page should contain all links of these Views.
Question No. 3 [10 Marks]
Please Copy your MVC Application Created in Question 2 and Paste it in anther Folder named Question 3.
1. Allow User to Register Themselves by using Asp.net Identity.
2. Allow Users to Login by using Asp.net Identity.
3. Create Two Roles 1. Teacher 2. Student in your application using asp.net identity.
4. Teacher Role should no be able to access Student Controller and Student Role Should not be able to access Teacher Controller.
5. Allow users to login via their facebook, twitter, linked in, gmail and Microsoft account.
Question No. 2 [10 Marks]
Create a New MVC Web application. Create a New Database in App_Data Folder WPLTASKDB. Create Four Table in your Database
Student -> StudentID (PK), Name, ClassID(FK), CampusID(FK)
Teacher -> TeacherID (PK), TeacherName, ClassID (FK), Qualification
Campus -> CampusID (PK), CampusName
Class -> ClassID(PK), ClassName
Create Four Controller in your Website, by using StudentController your Application should be able to Add, Update, Delete and View All Students, by using TeacherController your Application should be able to Add, Update, Delete and View All Teachers, by using CampusController your Application should be
able to Add, Update, Delete and View All Campus, by using ClassController your Application should be able to Add, Update, Delete and View All Classes.
The Home Page should contain all links of these Views.
Question No. 3 [10 Marks]
Please Copy your MVC Application Created in Question 2 and Paste it in anther Folder named Question 3.
1. Allow User to Register Themselves by using Asp.net Identity.
2. Allow Users to Login by using Asp.net Identity.
3. Create Two Roles 1. Teacher 2. Student in your application using asp.net identity.
4. Teacher Role should no be able to access Student Controller and Student Role Should not be able to access Teacher Controller.
5. Allow users to login via their facebook, twitter, linked in, gmail and Microsoft account.
Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
An input string is valid if:
Open brackets must be closed by the same type of brackets.
Open brackets must be closed in the correct order.
Example 1:
Input: s = "()"
Output: true
Example 2:
Input: s = "()[]{}"
Output: true
Example 3:
Input: s = "(]"
Output: false
Example 4:
Input: s = "([)]"
Output: false
Example 5:
Input: s = "{[]}"
Output: true
*Your program output should follow the example in the instruction.
* The program should print the input parentheses and the output (true/false).
*Parentheses.txt : ((()))
You are required to follow this program template I provide and use stack to solve the problem. Please test the program.
#include <stdio.h>
#include <stdlib.h>
// This is where the parentheses are stored in memory
char buffer[1024];
char stack_pop();
void stack_push(char ch);
int stack_size();
int main(){
FILE *fp;
// The parentheses sequences is in the parentheses.txt file.
fp=fopen("parentheses.txt","r");
if(fp==NULL){
printf("The input file does not exist.\n");
exit(-1);
}
// Read the parenthese sequences into buffer array.
fgets(buffer,1024,fp);
//printf("%s",buffer);
}
// The pop operation in the stack. To be done.
char stack_pop(){
return ')';
}
// The push operation in the stack. To be done.
void stack_push(char ch){
}
// The number of elements in the stack. To be done.
int stack_size(){
return 0;
}