Draw a flowchart which will compute the bonus of an employee . If the employees monthly salary is less than 1,000 pesos. the bonus is 50% of the salary. For employees with salary is greater than 1,000 pesos the bonus is 1,000. Print out the name and corresponding bones of the employee. Provide algorithm for this.
An algorithm is written to read ten numbers from the user. It adds all ten numbers together and works out the average. The average is then output.
Students captured 10 temperature readings in Celsius on a particular day. Write an Algorithm to input ten values and get the average temperature for that day. if the average temperature value is in between 970 Fahrenheit and 990 Fahrenheit then display the message “Your body temperature is normal…”. If it is more than 100.40Fahrenheit then display the message “You have a fever caused by an infection or illness…
Formulate a shortest path algorithm and find the shortest paths from two vertices
(i) V0 and
(ii)𝑉3 to the rest of the vertices in the following graph using Dijkstra’s single source
shortest path Algorithm.
Initialize a 10 bit number “num” of reg data type with a value 0 (i.e. num=10’b0000000000), now
make use of for loop to get the output result as num=10’b001100110011 (Note: It is mandatory to
use for loop for getting this output)
Design a form for booking accommodation through a rental website (20 marks)
The form should have the following fields:
Use Java script to validate all the fields.
Select
First Name
Last Name
Arrival Date
Departure Date
Country
Submit
Payment mode
Debit card Credit card
Reset
Submit button should enter all the fields’ data to the database.
Error message should be shown if a text field is left blank.
Reset button resets all the fields to the blank.
Design a check box for selecting a payment mode.
Design a drop down list for selecting a country field.
Implement Prim’s algorithm on your system. Process the result step by step and study the
performance of the algorithm on different graphs.
(i) Which is the most suitable graph representation scheme for a dense graph? Draw its
representation with the help of an example. What is the space complexity of a such
graph representation scheme?
(ii) How does DFS graph traversal scheme work? Explain.
(i) Formulate the Knapsack problem and write the pseudo code for solving a fractional
Knapsack problem. Also calculate its time complexity.
(ii) Find an optimal solution for the knapsack instance n (number of objects) =7 and
W ( totalweight) =15. Profits and weights of each object are shown below:
(p1, p2………..p7) = (10, 5, 15, 7, 6, 18, 3)
(w1, w2………w7) = (2, 3, 5, 7, 6, 4, 1)
Show all the steps.
(i) Define a recurrence relation using Divide and Conquer technique and describe its
elements
(ii) Solve the following recurrence relation using Recurrence Tree Method.
T(𝑛) = {1 𝑇(𝑛/2 ) + n
𝑖𝑓 n=1
𝑖𝑓 n> 1
Show all the steps.