homework

for loop structure

This program will calculate the average grade for 4 exams using a for loop by prompting the user for exam grades, one at a time, then calculate the average and display the result. public class ExamsFor4 { public static void main(String[] arguments) { int inputNumber; // One of the exams input by the user. int sum = 0; // The su...

string to integer

i have made a program which converts numbers entered into a string into an integer.like atoi does.but its giving wrong output. #include<stdio.h> #include<conio.h> #include<math.h> #include<string.h> void main(void) { static int sum; int i,x,y,z; char string[10]; printf("Enter a string:\n"); gets(string); x=strlen(string); for(i=0...

Websites/Books that have homework assignments for C#

Are there any websites or good books out there that have assignments like: Create a BackgroundWorker thread... blah blah blah I'm not a beginner programmer at all I actually have my degree as a computer programmer analyst but I would like to get more sharp with advanced concepts such as Threading, Generics, LINQ, DLINQ, etc. Thanks!...

Recurrence Relation: Solving Big O of T(n-1)

Hello, I'm solving some recurrence relation problems for Big O and so far up till this point have only encountered recurrence relations that involved this form: T(n) = a*T(n/b) + f(n) For the above, it's quite easy for me to find the Big O notation. But I was recently thrown a curve ball with the following equation: T(n) = T(n-1) + ...

Finding the number of two consecutive vowels in a string does not work.

When two vowels come one after another then the count should increment.But i dont know why its incrementing it more than that. #include<stdio.h> #include<conio.h> void main(void) { int i,j,count=0; char string[80]; printf("Enter a string:\n"); gets(string); for(i=0; ;i++) { if(string[i]=='\0') ...

Recurrence Relation: Finding Big O

Hello, I am trying to find the big O bound for the following recurrence relation: T(n) = T(n-1) + n^c, where c >= 1 is a constant So I've decided to solve this by using iteration: T(n) = T(n-1) + n^c T(n-1) = T(n-2) + (n-1)^c T(n) = T(n-2) + n^c + (n-1)^c T(n-2) = T(n-3) + (n-2)^c T(n) = T(n-3) + n^c + (n-1)^c + (n-2)^c T(n) = T(n-k...

Comparing loans with various interest rates

Write a program that lets the user enter the loan amount and loan amount period in number of years and displays the monthly and total payments for each interest rate starting from 5% to 8%, with an increment of 1/8. I have now clue how to do this and would be delighted if someone would explain it better than the book does and dumb ...

What does it mean to actually "Implement a stack"?

Is my professor asking me to draw the stack? Does he want me to draw it in action? I feel stupid but it's not like anyone ever told me! Thank you for your help. Wow you guys are quick. Thank you already. The complete question is: Consider two stacks, each of size n (i.e., each one can hold a maximum of n elements). If the sum of the num...

How can I reduce this problem to the Tower of Hanoi (or solve it in the least number of iterations)?

Suppose there are 2n+1 holes and 2 sets of n sticks, one set white and another black. The sticks are initially organized so that the white sticks are left, there is a hole in the middle and the black sticks are right. A stick can move by either: 1) being placed on the hole next to it, if empty 2) jump the neighboring stick iff the neig...

JavaScript is not working

My coding for JavaScript is not working and I can't figure out why. Can someone look it over and tell me what I am overlooking? This is for my JavaScript assignment the link below is the assignment. Every time I have attempted to run the coding, it opens up to a blank page. But I can't see where my error(s) are. All I need is for someon...

arrange strings in alphabetic order

/* write a program to sort names entered in an array in ascending order */ When i enter the names into the array the program halts .Anyone knows why? #include<stdio.h> #include<string.h> void main(void) { /* write a program to sort names entered in an array in ascending order */ int in,out,i,x; char temp[30],string2d[5][30]; ...

How to synchronize two runways so planes can land using java ?

Dear all, I seem to have a small problem. I have an Air Traffic Control Application, with two runways which I am to synchronize in java. This is to be done because, if there is a plane two that lands while plane one is in the process of landing, it(plane two) does not have to wait but can quickly move to the runway two to land. I have ...

Javascript still not working

I still can not get my coding to run. When I try to run the coding, a blank page shows up. Specifically, what do I need to do in order to get this simple coding to function? All I need is someone to look this over or test it and tell me what I need to get my coding to work. <html> <body> <script language="JavaScript"> <!-- var classCtr;...

Update and function

I am a student, this is part of my homework. I have to Update two employee's pay by 10%...is there a function for that or do I have to calculate the figures and just change the numbers i.e. update Employee set Wage=10 where Wage=51000 This is the entire question: choose an EEO-1 Classification: Increase all employees’ salaries that ...

ellipsoid using matlab

This is a class assignment. I had written some codes which I hope someone can help me. This is the code that I have % --- This is optional to verify whether my parametrization is consistent with the % --- original equation % syms x y z p t % ellipsoid=[2*sin(p)*cos(t),4*sin(t)*sin(p),sqrt(2)*cos(p)] % simplify(subs((x^2/4)+(y^2/16)+(...

How to make two planes land in two different synchronized runways in java ?

In my Air traffic Control application, I am trying to land two planes in two different runways. I have done synchronizing of 2 runways, sadly only one plane lands when I added about 3-4 planes. The order I should get is(I got this after synchronizing one runway): Order I got after synchronizing two runways(2 objects of the runway cla...

Recurrence Relation: Finding Big O

Hello, I'm trying to find Big O of this recurrence relation: T(n) = T(n-1) + n^c // where c is >=1 So I decided to solve this by using a recursion tree, which I have broken down as follows: n^c -> (n-1)^c -> (n-2)^c -> ... -> (n-i)^c I then formed the following sum: from 0 to n-1: (n-i)^c Reducing this sum gives: (n-(n-1))^c...

Declaring of arrays in C#

I have written the following code in an effort to try and compute the values down there below, but all my arrays do not work; especially the ones in the for loops. Can someone help teach me how to declare an array inside a loop? They keep showing errors like "Did you miss declaring a new object?" Thanks using System; using System.Coll...

what's the code of this input in C# console application

Please choose section. [1]Area [2]Volume if input is equal to 1 Area [1]square [2]rectangle [3]parallelogram [4]trapezoid [5]circle [6]ellipse [7]triangle [8]equilateral triangle if input is equal to 2 Volume [1]cube [2]rectangular prism [3]irregular prism [4]cylinder [5]pyramid [6]cone [7]sphere [8]ellipsoid Depending on the in...

What will print out?

What will print out? main() { char *p1=“name”; char *p2; p2=(char*)malloc(20); memset (p2, 0, 20); while(*p2++ = *p1++); printf(“%sn”,p2); } ...