In Software Engineer, What is forward engineering? Explain in detail.
In: Computer Science
In: Computer Science
Please write in C using linux or unix.please include pictures of the terminal output.
Write a program that will simulate non - preemptive process scheduling algorithm:
First Come – First Serve
Your program should input the information necessary for the calculation of average turnaround time including:
The output of the program should include: starting and terminating time for each job, turnaround time for each job, average turnaround time.
Step 1: generate the input data (totally 10 jobs) and save it in the array of structure composing the arrival time, service time, termination time, turnaround time. The service time follows the uniform distribution in the range of [5, 25], and the arrival time is generated by uniform distribution in the range of [0,10] accumulated based on the previous arrival time.
Step 2: program FCFS algorithm.
Note: be careful about the situation that one job is finished while the next job is not arrived yet, so you have the idle time between them.
Step 3: output
print out one line for each job with arrival time, start time, service, termination time, turnaround time, finally average turnaround time in the last line.
In: Computer Science
In: Computer Science
Garden
Lili inherited her grandfather’s land and wanted to start gardening. Lili’s garden size is X × Y with various types of plants marked with integer c.
Given a two-dimensional array that contains the type of plant in the garden. Lily wants to make T changes to the garden. For each change made, Lili will plant c in the a-th row of the b-th column of the array. The row and column starts from number 1.
Format Input:
The input consists of integers X and Y followed by an array of X × Y , then contains an integer T which is the number of changes made by Lili. The next T line contains three numbers a, b, c which contains the array location index you want to change to the integer c.
Format Output:
The output contains a two dimensional array in the form of a Lili garden plan after a change is made.
Constraints
• 1 ≤ a, b, c, X, Y ≤ 100
• 1 ≤ T ≤ 1000
Sample Input 1 (standard input):
3 3
1 1 1
1 1 1
1 1 1
3
1 1 3
2 2 3
3 3 3
Sample Output 1 (standard output):
3 1 1
1 3 1
1 1 3
Sample Input 2 (standard input):
5 3
1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
3
1 1 16
1 2 17
1 3 18
Sample Output 2 (standard output):
16 17 18
4 5 6
7 8 9
10 11 12
13 14 15
note : USE C language, integer must be the same as the constraint, DONT USE VOID, RECURSIVE(RETURN FUNCTION), RESULT, code it under int main (must be blank){
In: Computer Science
In Windows system programming, many system resources are represented as kernel objects, each of which is represented as a handle. Discuss with 3 examples how the system programmer can manipulate these handle objects.
In: Computer Science
23. Consider a trigger which archives deleted rows from a table into a separate archive table.
a. Is using a trigger to achieve this using needless computation power?
b. What is another way of implementing this feature without using triggers?
c. What are the arguments in favour of this solution?
d. What are the arguments against this solution?
23. Consider a trigger which archives deleted rows from a table into a separate archive table.
a. Is using a trigger to achieve this using needless computation power?
b. What is another way of implementing this feature without using triggers?
c. What are the arguments in favour of this solution?
d. What are the arguments against this solution?
In: Computer Science
Write a simple airline ticket reservation program. The program should display a menu with the following operations: reserve a ticket, cancel a reservation, check whether a ticket is reserved for a person, and display the passengers. The information is maintained on an alphabetized linked list of names. In a simpler version of the program, assume that tickets are reserved for only one flight. In a fuller version, place no limit on the number of flights. Create a linked list of flights with each node including a pointer to a linked list of passengers.
In C++ language.
In: Computer Science
(Use C++ language) The Bunker Hill Health Club would like you to create a program where users can sign up for memberships. They have three types: Single Membership ($200/year), Family Membership ($350/year), and Membership Plus ($450/year). Your program should display a menu of the membership types and a fourth choice labeled 'Quit', if they don't want to join. Use a Switch-Case decision structure where a message would be displayed stating the membership type they chose and the yearly cost. A default message of 'Invalid choice' should appear if they don't enter a valid entry.
In: Computer Science
Implement a version with the outer loop, with a while loop, and the inner loop with a do / while loop.
Modify this program as he ask ↑↑↑ C++
// This program averages test scores. It asks the user for
the
2 // number of students and the number of test scores per
student.
3 #include <iostream>
4 #include <iomanip>
5 using namespace std;
6
7 int main()
8 {
9 int numStudents, // Number of students
10 numTests; // Number of tests per student
11 double total, // Accumulator for total scores
12 average; // Average test score
13
14 // Set up numeric output formatting.
15 cout << fixed << showpoint <<
setprecision(1);
16
17 // Get the number of students.
18 cout << "This program averages test scores.\n";
19 cout << "For how many students do you have scores?
";
20 cin >> numStudents;
21
22 // Get the number of test scores per student.
23 cout << "How many test scores does each student have?
";
24 cin >> numTests;
25
26 // Determine each student's average score.
27 for (int student = 1; student <= numStudents;
student++)
28 {
29 total = 0; // Initialize the accumulator.
30 for (int test = 1; test <= numTests; test++)
31 {
32 double score;
33 cout << "Enter score " << test << " for
";
34 cout << "student " << student << ": ";
35 cin >> score;
36 total += score;
37 }
38 average = total / numTests;
39 cout << "The average score for student " <<
student;
40 cout << " is " << average << ".\n\n";
41 }
42 return 0;
43 }
In: Computer Science
C PROGRAMMING LANGUAGE
PROBLEM TITLE : ARRAY
usually, if people want to input number into an array, they will put it from index 0 until N - 1 using for. But, Bibi is bored to code like that. So, she didin't want to input the number that way.
So Bibi challenged you to make a program that will read a sequence (represent index) that she made, then input the number to an array but input it with the same sequence as sequence that Bibi gave.
Format Input
The first line represent integer N the size of Bibi's Array. The next line consist N integers Ai represent the sequence that Bibi want, it is guaranteed that the number is distinct. The next line consist N integers represent the value that she want to put inside array with index Ai.
Format Output
N integers represent the array that Bibi has starting from index 0.
Constraints
• 1 ≤ N ≤ 1, 000
• 0 ≤ Ai < N
Sample Input 1 (standard input)
5
0 1 2 3 4
1 2 3 4 5
Sample Output 1 (standard output)
1 2 3 4 5
Sample Input 2 (standard input)
5
4 3 2 1 0
1 2 3 4 5
Sample Output 2 (standard output)
5 4 3 2 1
sample Input 3 (standard input)
5
0 4 3 1 2
1 2 3 4 5
Sample Output 3 (standard output)
1 4 5 3 2
NOTES
• There isn’t any space after the last number.
• In the third sample Bibi want to input the number to array index 0 then 4 then 3 then 1 then 2
(MAKE THE COMPILER UNTIL SAMPLE 3)
In: Computer Science
Create a class of DSA with two pointer objects of Employee and Customer. These objects will represent the head pointer of corresponding linkedlists.
Add new data member functions searchCustomer & searchEmployee, to search for customers and employees separately in DSA.
In: Computer Science
A new company is planning to build a new database system for holding information about customers and salesmen. ‘Customers’, ‘Salesmen’ and ‘Customers_Salesmen’ are part of the information that the new company wants to store in the new database. These tables are shown below in figure 1, figure 2 and figure 3. The new company intends to use MySQL for building the new database.
Customer_ID |
Customer_Name |
Customer_City |
Customer_Grade |
3002 |
Ahmad Salman |
New York |
100 |
3007 |
Mazen Ali |
New York |
200 |
3005 |
Sami Khalil |
California |
200 |
3008 |
Ashraf Ahmad |
London |
300 |
3004 |
Manal Faris |
Paris |
300 |
3009 |
Tahani Mahdi |
Berlin |
100 |
3003 |
Fawzi Jama |
Moscow |
200 |
3001 |
Tareq Mohsen |
London |
100 |
Figure 1: Customers table
Salesman_ID |
Salesman_Name |
Salesman_City |
Salesman_Commission |
5001 |
Naser Hamad |
New York |
0.15 |
5002 |
Rami Farhan |
Paris |
0.13 |
5006 |
Salem Alawi |
Paris |
0.14 |
5003 |
Faten Morad |
San Jose |
0.12 |
5007 |
Turkey Fahad |
Rome |
0.13 |
5005 |
Juma Khalaf |
London |
0.11 |
Figure 2: Salesmen table
Customer_ID |
Salesman_ID |
3002 |
5001 |
3007 |
5001 |
3005 |
5002 |
3008 |
5002 |
3004 |
5006 |
3009 |
5003 |
3003 |
5007 |
3001 |
5005 |
Figure 3: Customers_Salesmen table
Based on the above three tables, answer the following 6 questions:
In: Computer Science
Explain each of the following (in your own words):
a. The 3 fundamental rules of subprograms
b. Subprogram
c. Subprogram call
d. Subprogram Header
e. Parameter profile/Protocol
f. Formal Parameter–v-Actual Parameter
g. Procedure –v-Function
h. Design issues for subprograms
i. Stack dynamic –v-static variables
j. Parameter passing
i. In-mode
ii. Out-mode
iii. In-Out mode
1.Pass by result
2.Pass by reference
3.Pass by name
k. Design issues for parameter passing
l. Overloaded subprogram
m. Generic subprogram
n. Design issues for functions
In: Computer Science
Given the following data set N =9
12 3 78 89 22 31 5 20 14
a ) sort the data using: Insertion and Selection sorts
Determine thee number of comparisons and the number of moved for every sort.
b) Sort the data using Heap and bubble sort, show all steps
In: Computer Science