Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Suppose a business person launches new cinema at Islamabad and ask his team to develop a ticket system for box office. He assigns some requirements about system that how should it work. The requirements are such a way that there are only '5' number of box office windows in the theatre. Each window can have at max '20' number of people waiting in line. To start with, only one window is opened. If the number of people waiting in line in that window exceeds 20, then the next window is opened and people can join the line in that window. Likewise, if both the first and second windows have n number of people waiting in each queue, then a third window is opened. This can go on until the maximum number of windows w is reached. Let us assume that once a window is opened it never closes. A new window is only opened if all open windows are full. Each person can buy only one ticket. So, the system should not allot more than one ticket per person. Let us assume that the system issues one ticket each across all open windows. When a ticket is issued, the count of the number of people in each open queue is reduced by 1.

When a new person has to join the queue, the system has to prompt him to join a queue such that they are issued a ticket as fast as possible. The system prompts the person based on these factors: o First it looks for an open window with the least number of people and prompts that window number. If more than one window has the least number of people, then the system can prompt the person to join the first window (smaller window ld) it encounters with the least number of people. If the queues of all open windows are full and a new window can be opened, then the new person is prompted to join the new queue for the new box office window. O If all queues for all windows are full, a corresponding message is displayed. That person need not be considered in the next iteration .After a queue is prompted to a person, the person or system cannot change the queue.

Implement the system based on above scenario in java using suitable data structure.



Write a program to output the following quote by Edsger W. Dijkstra:

”computer Science is no more about computers

than astronomy is about telescopes”

-Edsger w. Dijkstra


Create a New ASP.NET Core MVC Web application. Create a New Database in App_Data Folder
WPLTASKDB. Create Three Tables in your Database
Patient -> PatientID (PK), PatientName, Age, DateofAdmission
PatientDetail -> PatientId(PK), DiseaseID(PK)
Disease -> DiseaseID (PK), DiseaseName, Medications, Symptoms
Create Three Controller in your Website, by using Patient Controller your Application should be able
to Add, Update, Delete and View All Patient, by using Disease Controller your Application should be
able to Add, Update, Delete and View All Disease, by using PatientDetail Controller your Application
should be able to Add, Update, Delete and View All PatientDetail.
The Home Page should contain all links of these Views.

Jerri Khan established a roadside tea stall 1983. Over the years the number of customers and 

products have grown. Due to the increase in the business Jerri has hired staff for various 

positions including cashiers and waiter to provide service round the clock.

Jerri found that it was easier to manage the shop by himself, but since the business has grown 

and number of staff are involved, he requires a mechanism to get a clear visibility of the day-to-

day operations of the shop. He has been recommended to put in a cheap computer with a 

software for the cashier’s desk.

Generally, people walk into the shop and take any available seat. The order is taken by the 

waiter. The customers can choose any item(s) mentioned in the menu (sample as follows).

The customers need to settle the bill as the cashier’s counter before leaving the premises. The 

cashier enters the items ordered by the customers into the system. This helps keep the detailed 

record of sales. A sample of the receipt is as follows:

You are required to write console mode applications using C Programming for the following 

tasks.



Task #1 Marks

Write a to create a catalogue of products that are sold in the shop. The situation requires that you 

allow Jerri to:

1. Add Items by Entering in real time.

2. Add Items by Importing from plain text file

3. Remove a single item

4. Remove all items

Make sure that the items are uniquely identifiable.


Task #2 Marks

Write a program for the cashier(s) to allow them to record day-to-day transaction. The program 

should allow the cashier to add items to invoice from the catalogue created in Task #1. The 

invoice should contain:

1. List of items purchased by the customer

2. Unit price of each item

3. Quantity purchased

4. Subtotal of each item

5. Total Value of all items purchased.


Task #3 Marks

Write a program that will allow Jerri to generate summarized report of the daily transaction. The 

report should contain following:

1. Quantity of the items sold for every item on the catalogue

2. Total of amount sales in Rupees for every item on the catalogue

3. Sum of All the daily sales


Task #4 Marks

1. Write a user manual for Task #1, Task #2, and Task #3.

Create user manuals to help train Jerri and the cashiers to use the system.

1. Write a technical documentation for Task #1, Task #2, and Task #3.



Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and output the gas cost for 20 miles, 75 miles, and 500 miles.

Output each floating-point value with two digits after the decimal point, which can be achieved by executing

cout << fixed << setprecision(2); once before all other cout statements.


write a to create a of prcatalogueoducts that are sold in the shop. the situation requires that you allow jerri to: 1. add items by entering in real time. 2. add items by importing from plain text file 3. remove a single item 4. remove all items make sure that the items are uniquely identifiable.


Q.2. Suppose, for a Salat management system, you have the following information: (10 marks)

Person Name,    Gender    , Age,    Date,    Time,    Prayed    Rakats,    Ontime/Offtime, Time to pray

a. Identify the associated updation/deletion anomalies if the data is stored as it is in a single table

b. Identify functional dependences/ transitive dependencies    that can be used to normalize 

c. Normalize the database into constituent tables   


Q.4. Answer the following as SQL queries. Also write corresponding relational algebra expression:                                              (15 marks)

    a. Number of rakats prayed as Qaza by each person

    b. How many females have skipped fajar salah on 1st shawwal

    c. How many salah are missed by Mr. Noman

    d. Average time M. Noman takes for praying Isha Salah

    e. Which salah is missed mostly by M. Saleem

    f. Which salah is missed the second most by all people



  



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;

}


Islamabad visited by 53 students, Lahore visited by 52 students, Murree visited by 65 students. Islamabad & Lahore visited by 19 students. Murree & Lahore visted by 28 studerts. Islamabad & Murree visited by 31

students. 38 of them visited exact'y one of the three cities like slamabad, Lohore & Murree. (15)

How many students visited only Islamabad?

How many students visited only Lahore?

How many stuadents visited only Murree?

How many students visited only Islamabad & Lahore but not Murree?

How many students Visited only Muree & Lahore but not Islamabad

How many students visited only Islamabad & Murree but not Lahore?

How many students visited all of the three cities?



LATEST TUTORIALS
APPROVED BY CLIENTS