[solved] – Question 85287
Prove or disprove the following:
1. lg√n ∈ O(lg n)(√n means square root of n)
2. lg n ∈ O(lg√n)
3. 2n+1 ∈ O(2n)
Expert Answer
[solved] – Question 85300
1.Write an algorithm to add three numbers.
2.Write an algorithm to calculate the average of four numbers.
3.Write an algorithm that will read the two sides of a rectangle and calculate its area.
4.Write an algorithm to determine a studentâs final grade and indicate whether it is passing or failing. The final grade is calculated as the average of four marks.
5.Write an algorithm for evaluation of equation:
Y = a (b – c)2 / d + 2
Expert Answer
[solved] – Question 85336
Write the definition of a class Counter containing:
An instance variable counter of type int, initialized to 0.
A method called increment that adds one to the instance variable counter. It does not accept parameters or return a value.
A method called get_value that doesn’t accept any parameters. It returns the value of the instance variable counter.
Expert Answer
[solved] – Question 85337
what is a possible output of “print (random.random()*5)”
Expert Answer
[solved] – Question 8541
Input a list of positive numbers (terminated by 0) into an array, find the largest number in the array, and output the result. Use a subprogram to input the numbers, a function to find the largest number, and a subprogram to output the result.
Expert Answer
[solved] – Question 8543
I posted one programming project 2 days ago and have not heard anything from anybody
Expert Answer
[solved] – Question 8544
// Qs. Write java program that contains the following 2 classes.
(i) Circle class that contains a radius field and getArea method that calculates its area.Give it a constructor where u pass in the radius.
(ii) TestCircle class which creates an array of 100 circles, each with a a random radius and prints out the sum of the areas , the biggest & smallest areas
class Circle {
private float radius;
public Circle(float r)
{
this.radius=r;
}
public float getArea()
{
return (float)(Math.PI*radius*radius);
}
}
class circle7
{
public static void main(String[] args)
{
Circle circles[]= new Circle[100];
for(int i=0; i<circles.length; i++)
{
circles[i]= new Circle((float)(50*Math.random()));
showAreas(circles);
System.out.println(“the sum is”+ areaSum(circles));
System.out.println(“the minimum is”+ minArea(circles));
System.out.println(“the maximum is”+ maxArea(circles));
}
public static float areaSum(Circle c[])
{
float sum= 0;
for(int i=0; i<c.length; i++)
{
sum+= c[i].getArea();
}
return sum;
}
public static float minArea(Circle c[])
{
float min= c[0].getArea();
for(int i=1; i<c.length; i++)
{
if(c[i].getgetArea()<min)
min= c[i].getArea();
}
return min;
}
public static float maxArea(Circle c[])
{
float max= c[0].getArea();
for(int i=1; i<c.length; i++)
{
if(c[i].getgetArea()>max)
max= c[i].getArea();
}
return max;
}
public static void showAreas(Circle c[])
{
for(int i=0; i<c.length; i++)
{
System.out.println(c[i].getArea());
}
}
}
// Can someone plz find the errors in the program? Cuz the compiler is giving 8 errors.
Expert Answer
[solved] – Question 85476
Create a Windows application that can be used as a sign-up sheet for ski equipment for the Flyers Sports Club. The club has ski equipment that it makes available to members at a minimal charge. In an attempt to determine what type of equipment members might need for an upcoming trip, they have asked you to design and implement an equipment-needs form. Include CheckBox objects that allow users to select the type of gear they will need to purchase for the trip. Include selections of snow gloves, skis, goggles, earmuffs, and other items you feel are appropriate. Include at least one picture
Expert Answer
[solved] – Question 85535
I’m trying to evaluate the limit :::::
Limit[(sqrt[t^2 + 9] – 3)/(t^2), t -> 0]
When i click “evaluate cell” Mathematica outputs :::::
!(*UnderscriptBox[([Limit]), (t [Rule] 0)]) (-3 +
sqrt[9 + t^2])/t^2
which is the same thing as what I typed in only in a slightly different order (essentially the same thing i typed in) what am i doing wrong ?
Expert Answer

