Not Yet Answered # how write an algorithm..plz urgent..

peter_budo 2,516 Godstryke 56 gpremkum -7 gpremkum -7 ithelp 757 peter_budo 2,516 Discussion Starter ganesh5155 -13

0

Not such problem as long you will show what you did so far as we do have following policy We only give homework help to those who show effort

0

hi all i need ur help to solve this problem

1. write an algorithm to find the average of there number called a,b,c

2. write an algorithm to add up all odd numbers between 0 and 100

3. what data type for

(i) True ]if data type for 123 is Int

thanks

Put some effort into it. No one's going to write code for you. If you're stuck on how to begin, figure out in detail what your code needs to do.

Tips:

1) What do you do when you average? If there are three numbers, you add them up and then divide by three. What, therefore, does your code need to do?

2) If a given number x is odd, then using modulus, x%2 = 1. How can your code use this means of IDing odd numbers to analyze numbers between 1 and 100?

3) A variable which is either true or false is known as a boolean.

0

Hi Ganesh5155,

I am sorry to say that u should not give question of your assignment without giving your answer of your assignment. This shows that you have not done your research and hope for the public answers. If you shows your answers to the public and we can help you by correcting your mistakes and discussion of your topic starts automatically. "Your answers shows your efford". This is some nice advise from me to you.:) So for this time I will help you and I hope next time you will show your effort.

-1

Hi All,:)

After many research and referance that I have done I got the answer of Ganesh5155 questions but I am not sure weather my algorithm is right or not because I am in the process of learning Java. So I hope I could get some positive feedback,response and advise from all of you.:icon_smile:

Question (a):-/

Input Num 1=a //read a as an int a

Input Num 2=b //read b as an int b

Input Num 3=c //read c as an int c

Begin

Count average=(a+b+c)/3

End

Print "Count average"

Question (b):icon_frown:

Input Num 1=x // read x as 0<=100

Input Num 2=y//read y as odd numbers

Begin

y=x%2=1 //modulus by 2 gets 1

Total y=y+x //total up all the odd numbers

Total x=x+1//increase the x value

End

Print "Total y"

Thanks:)

0

Hi All,:)

After many research and referance that I have done I got the answer of Ganesh5155 questions but I am not sure weather my algorithm is right or not because I am in the process of learning Java. So I hope I could get some positive feedback,response and advise from all of you.:icon_smile:

Question (a):-/

Input Num 1=a //read a as an int a

Input Num 2=b //read b as an int b

Input Num 3=c //read c as an int c

Begin

Count average=(a+b+c)/3

End

Print "Count average"Question (b):icon_frown:

Input Num 1=x // read x as 0<=100

Input Num 2=y//read y as odd numbers

Begin

y=x%2=1 //modulus by 2 gets 1

Total y=y+x //total up all the odd numbers

Total x=x+1//increase the x value

End

Print "Total y"

Thanks:)

What kind of research you had to do ? I thought these are trivial homeworks

0

Not sure what sort of research you playing at.

Ganesh5155 posted his requirements in hope that somebody will take pity on him and do his homework. Since hist first and also last post he did not care to comment on anything and not even tried to solve issue. Either he got answer on some other forum, or he sweet-talked some other student to show him solution or he did not submit and failed.

Personally I couldn't care less.If you do not show interest, why shall I help you at all...

Hi All,:)

After many research and referance that I have done I got the answer of Ganesh5155 questions but I am not sure weather my algorithm is right or not because I am in the process of learning Java. So I hope I could get some positive feedback,response and advise from all of you.:icon_smile:

Question (a):-/

Input Num 1=a //read a as an int a

Input Num 2=b //read b as an int b

Input Num 3=c //read c as an int c

Begin

Count average=(a+b+c)/3

End

Print "Count average"Question (b):icon_frown:

Input Num 1=x // read x as 0<=100

Input Num 2=y//read y as odd numbers

Begin

y=x%2=1 //modulus by 2 gets 1

Total y=y+x //total up all the odd numbers

Total x=x+1//increase the x value

End

Print "Total y"

Thanks:)

-1

hi all......

thanks for ur reply......

n special thanks to gpremkum.....

gpremkum ur answer is correct.....

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles

I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:

```
try
{
Runtime run = Runtime.getRuntime();
Process pr = ...
```

I don’t want at this stage work on a big separate project as I've already got plenty ...

Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.

btn_addline :

`Private Sub btn_addline_Click(ByVal ...`