i. List the different types of horizontal distance measurement methods.
ii. Among the list which method is fastest one and why, explain the principles followed in the same method.
In: Civil Engineering
You have been assigned to discuss diuretics in post conference.
a) Define the term diuretic.
b) List the five types of diuretic drugs and list the major site of action.
In: Nursing
write a java program to Implement a Priority Queue using a linked list. Include a main method demonstrating enqueuing and dequeuing several numbers, printing the list contents for each.
In: Computer Science
In python I want to create a function that takes in a linked list. Using recursion only, I want to check if the linked list is sorted. How do i do this?
In: Computer Science
Given a list of 4096 sorted values, about how many comparisons
can you expect to be performed to look for a value that's not in
the list using the
bubble sort algorithm?
In: Computer Science
List the arithmetic operators used in BASIC and state their priorities of execution in a statement. Also give a list and briefly explain the functions of the most popular statements.(IN OWN WORDS MIUST BE)
In: Computer Science
1.)recursive merge sort on a list.(Python)
2.)recursive bubble sort using a list without enumerate() function.(python)
Show Base case, and recursive case.
In: Computer Science
Can someone please provide C# code in Events,Delegates and Reflection for the below problem.
-----------------
Agent-Policy
XYZ Assurance wants to categorize the policies based on the agent who sold the policy and the Insurance type. Given an Agent name, display the policies that were sold by that agent. Similarly, print the policies in the given Insurance type. Write a program to do the same. They have a list of few policies and want to update the list with a few more policies.
Create a class named Agent with the following
attributes
| Data Type | Variable Name |
| int | _id |
| string | _name |
Include appropriate Properties as follows.
private string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}
Include a 2 argument constructor with _id and _name as
arguments.
Create a class named InsuranceType with the
following attributes
| Data Type | Variable Name |
| int | _id |
| string | _type |
Include appropriate properties.
Include a 2 argument constructor with _id and _type as
arguments.
Create a class named Policy with the following
attributes
| Data Type | Variable Name |
| int | _id |
| InsuranceType | _insuranceType |
| Agent | _agent |
| double | _premiumPayable |
Include appropriate Properties.
Include a 4 argument constructor with _id
,_insuranceType,_agent,_premiumPayable as arguments.
Create a class named PolicyBO and include the
following method,
| Method Name | Method Description |
| ListPoliciesByAgent(List<Policy> policyList, String name) | The return type of this method is List<Policy>. This method returns a list of policies for given agent |
| ListPoliciesByType(List<Policy> policyList, String type) | The return type of this method is List<Policy>. This method returns a list of policies under given insurance type |
Create a class named Program to test the above
classes.
The collection for Policy class is prepopulated with predefined
values, and get n details from the user and add it to the
predefined list.
Get the policy details as a single string separated by " , " in the
order policy id, insuranceType id, insurance type, agent id, agent
name, premium payable. Split the input using Split() method, and
store the policy details in a list of type Policy.
Create a delegate method named
AgentPolicyList(List<Policy> policyList,string
_agentName) with List<Policy> as return type, and
call the ListPoliciesByAgent method using this
delegete method,to get the list of policies for given agent.
Use String.Format("{0, -20}{1, -20}{2:#.00}",
"PolicyId","InsuranceType","PremiumPayable"), to display the
policies for agent.
Create another delegate method named
TypePolicyList(List<Policy> policyList, string
_insuranceType) with List<Policy> as return type,
and call the ListPoliciesByType method using this
delegete method,to get the list of policies for given insurance
type.
String.Format("{0, -20}{1, -20}{2:#.00}",
PolicyId,InsuranceType,PremiumPayable), to display the policies for
insurance type.
Input and Output Format :
First line of the input corresponds to the number of policy
details, n.
Next n lines of the input corresponds to the Policy details
separated by " , ".
(n+1)th line of the input corresponds to the name of the agent
name, to get the policy details.
Last input corresponds to the insurance type, to get the policy
details.
All text in bold corresponds to input and rest corresponds to
output.
The following logs are already present in the Policy list. These
values have to be prefilled before adding new policy details.
| PolicyId | InsuranceTypeId | InsuranceType | Agent Id | User | PremiumPayable |
| 2154 | 3158 | Life Insurance | 154 | Jacob | 25000 |
| 3401 | 3548 | Health Insurance | 251 | Daniel | 30000 |
| 2549 | 3154 | Vehicle Insurance | 154 | Jacob | 15000 |
| 3504 | 3158 | Life Insurance | 251 | Daniel | 20000 |
| 2501 | 3548 | Health Insurance | 624 | Andrew | 35000 |
| 2509 | 3154 | Vehicle Insurance | 624 | Andrew | 27000 |
Sample Input and Output :
2
2541,3254,Life Insurance,251,Aiden,20000.50
2571,3846,Health Insurance,154,Joseph,15000
Daniel
Policy List
PolicyId
InsuranceType
PremiumPayable
3401
Health Insurance 30000.00
3504
Life
Insurance
20000.00
Life Insurance
Policy List
PolicyId
Agent
PremiumPayable
2154
Jacob
25000.00
3504
Daniel
20000.00
2541
Aiden
20000.50
--------------------------
Thanks
In: Computer Science
1. Test the execution time of the program in Code 3. Make a screen capture which shows the execution time that has the unit of machine time unit.
Code3
SOURCE.CPP
# include<fstream>
# include "List.h"
# include <iostream>
using namespace std;
int main()
{
List temps;
int oneTemp;
ifstream inData;
ofstream outData;
inData.open("temp.dat");
if (!inData)
{
outData<<"Can't open file temp.dat" <<
endl;
return 1;
}
inData >> oneTemp;
while (inData && !temps.IsFull())
{
if (!temps.IsPresent(oneTemp))
temps.Insert(oneTemp);
inData >> oneTemp;
}
outData << "No. of uniqiue readings:" <<
temps.Length() << endl;
temps.Reset();
while (temps.HasNext())
{
oneTemp = temps.GetNextItem();
outData << oneTemp << endl;
}
temps.Delete(23);
outData << "Readings without value of 23." <<
endl;
temps.Reset();
while (temps.HasNext())
{
oneTemp = temps.GetNextItem();
outData << oneTemp << endl;
}
temps.SelSort();
outData << "Readings after the sort algorithm." <<
endl;
temps.Reset();
while (temps.HasNext())
{
oneTemp = temps.GetNextItem();
outData << oneTemp << endl;
}
inData.close();
outData.close();
system("pause");
return 0;
}
LIST.CPP
// Implementation file array-based list
// (“list.cpp”)
#include "List.h"
#include <iostream>
using namespace std;
List::List()
// Constructor
// Post: length == 0
{
length = 0;
}
int List::Length() const
// Post: Return value is length
{
return length;
}
bool List::IsFull() const
// Post: Return value is true
// if length is equal
// to MAX_LENGTH and false otherwise
{
return (length == MAX_LENGTH);
}
bool List::IsEmpty() const
// Post: Return value is true if length is equal
// to zero and false otherwise
{
return (length == 0);
}
void List::Insert(/* in */ ItemType item)
// Pre: length < MAX_LENGTH && item is assigned
// Post: data[length@entry] == item &&
// length == length@entry +
1
{
data[length] = item;
length++;
}
void List::Delete( /* in */ ItemType item)
// Pre: length > 0 && item is assigned
// Post: IF item is in data array at entry
// First occurrence of item is no longer
// in array
// && length == length@entry -
1
// ELSE
// length and data array are
unchanged
{
int index = 0;
while (index < length &&
item != data[index])
index++;
// IF item found, move last element into
// item’s place
if (index < length)
{
data[index] = data[length - 1];
length--;
}
}
ItemType List::GetNextItem()
// Pre: No transformer has been executed since last call
// Post:Return value is currentPos@entry
// Current position has been updated
// If last item returned, next call returns first
item
{
ItemType item;
item = data[currentPos];
if (currentPos == length )
currentPos = 0;
else
currentPos++;
return item;
}
bool List::IsPresent( /* in */ ItemType item) const
// Searches the list for item, reporting
// whether found
// Post: Function value is true, if item is in
// data[0 . . length-1] and is false otherwise
{
int index = 0;
while (index < length && item != data[index])
index++;
return (index < length);
}
void List::SelSort()
// Sorts list into ascending order
{
ItemType temp;
int passCount;
int sIndx;
int minIndx; // Index of minimum so far
for (passCount = 0; passCount < length - 1;
passCount++)
{
minIndx = passCount;
// Find index of smallest value left
for (sIndx = passCount + 1; sIndx < length;
sIndx++)
if (data[sIndx] < data[minIndx])
minIndx = sIndx;
temp = data[minIndx]; // Swap
data[minIndx] = data[passCount];
data[passCount] = temp;
}
}
void List::Reset()
{
currentPos = 0;
}
bool List::HasNext() const
{
return(currentPos != length);
}
LIST.H
#pragma once
#include<iostream>
using namespace std;
const int MAX_LENGTH = 110000;
typedef int ItemType;
class
List //
Declares a class data type
{
public:
//
Public member functions
List();
// constructor
bool IsEmpty() const;
bool IsFull() const;
int Length() const; // Returns length of list
void Insert(ItemType item);
void Delete(ItemType item);
bool IsPresent(ItemType item) const;
void Reset();
ItemType GetNextItem();
void SelSort();
bool HasNext() const;
private: // Private data members
int length; // Number of values currently stored
int currentPos; // Used in iteration
ItemType data[MAX_LENGTH];
};
In: Computer Science
What is the temperature on the winter day?
On a warm summer day (33 ∘C), it takes 4.70 s for an echo to return from a cliff across a lake. On a winter day, it takes 5.10 s . The speed of sound in air is v≈(331+0.60T)m/s, where T is the temperature in ∘C.
In: Physics