Questions: 1 362

Answers by our Experts: 1 362

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 & Filtering

Need some help with a C# programming assignment. Timeframe. Need by 5 pm EST today. Using Microsoft Visual Studio C# 2010.

Assignment #7

Functionality



The .NET BCL lacks an implementation of a Set class. Your job is to implement a basic Set class. For this

assignment, we’ll use the following definition of a set:



A set is an unordered collection of unique objects of a homogenous type.



ISet<T> and Set<T>



Implement a generic interface called ISet<T> that defines the following methods:



void Add(T element). Adds an element to the set. Does nothing is the element is already in

the set.

T Remove(T element). Removes the element from the set. The removed element is returned.

If the element does not exist, returns null.

bool Contains(T element). Returns a bool value indicating if the given element is currently a

member of the set.

ISet<T> Intersect(ISet<T> otherset). Returns the intersection of the two sets as a new

ISet<T>.
Write a program that prints the following diamond shape. You may use output statements that print a single asterisk (*), a single space or a single newline character.

*
* * *
* * * * *
* * * * * * *
* * * * *
* * *
*
Use all programming techniques that you have learnt so far, approximate the root of f(x) = x3 - 3 with the bisection method starting with the interval [1, 2] and use εstep = 0.1 and εabs = 0.1.
Write a flowchart for your design.

Hints:

Initial Requirement:

We have an initial bound [a, b] on the root, that is, f(a) and (b) have opposite signs.


Iteration Process:

Given the interval [a, b], define c = (a + b)/2. Then
•if f(c) = 0 (unlikely in practice), then halt, as we have found a root,.
•if f(c) and f(a) have opposite signs, then a root must lie on [a, c], so assign b = c,.
•else f(c) and f(b) must have opposite signs, and thus a root must lie on [c, b], so assign a = c..


Halting Conditions:

There are three conditions which may cause the iteration process to halt:
1.As indicated, if f(c) = 0..
2.We halt if both of the following conditions are met: ◦The width of the interval (after the assignment) is sufficiently small, that is b - a < εstep, and.
◦The function evaluated at one of the end point |f(a)| or |f(b)| < εabs..
.

If we halt due to Condition 1, we state that c is our approximation to the root. If we halt according to Condition 2, we choose either a or b, depending on whether |f(a)| < |f(b)| or |f(a)| > |f(b)|, respectively.
Running on a particular treadmill, you burn 3.9 calories per minute. Create an application that uses a loop to display the number of calories burned after 10, 15, 20, 25, and 30 minutes.
Write a C# program that:
• Asks the user to enter the desired weekly pay rate.
• Reads the desired pay rate from the user.
• Checks the pay rate if it is more than or equals to 1000, prints the message "You
should work more than 35 hours.".
• Checks the pay rate if it is between 500 and 1000, prints the message "You should
work between 25 to 40 hours.".
• Otherwise, prints the message "Your weekly pay rate is not correct.".
Is there any difference in allocation of memory to the members of the class and object. Justify the Statement that “the Dynamic Constructor helps in utilizing the memory efficiently. Illustrate with the help of an example.
I have a button that stores strings in an array but I can click it several times and add the same value to it. I just want to know how to code that when I press the button it will prompt a message and don't add the strings to the array. Please help me. Thank you.
input N integers (ask from the user how many numbers he/she wants to input) determine and print the sum of all numbers, the average of all numbers, how many odd numbers were inputted, how many even numbers were entered and how many zeroes inputted
Hey. I just wanted to know a couple of things about programming. So first off im only 15 and i enjoy programming for windows phone mobiles. In this case it's the basics. But i want to improve from where i am. I only know the basics of c# but not for windows phone c#. For the desktop it's alright and i can manage but not for windows phone. This is because the apps i make are mostly viewing and navigating. It doesn't have that many code. So in order for me to learn c# would i have to start from the very beginning as in like x# for dummies and know everything in detail or can u just learn the needed. I just want to know where i can start from. I want to focus quite a lot on c# or xmal and that's all but where can i start learning from. That's the bit i get confused at because i don't know if i need to learn the basics or just learn the bits i need.
What is the output of this C# code?
delegate void d(int i);
class P {
public static void Main() {
td(new d(ff));
}
public static void td (d sf) {
sf(-9);
sf(22);
}
public static void ff (int i) {
System.Console.Write("{0} ", -(i-2));
} }
LATEST TUTORIALS
APPROVED BY CLIENTS