raunakjava
| Subject: pc project Mon Jun 06, 2011 11:58 pm | |
| ques.1 :- The russian peasants have an interesting way of doing multiplication of integers( not very large nos.) The method can be illustrated by the following example:
if nos: 17 and 19 have to be multiplied they are put at the top of 2 columns. the no at the LHS is successively divided by 2 (integer divison)while the other number is successively multiplied by 2. the results are written one below the other in respectives columns . The process is repeated till the col containing dividion reaches one At this stage al the nos the RHS col are struck off , where the no corresponding on the LHS col. is even . Now the remainig nos on the RHS are added WAP to accept 2 integer 'm' and 'n' consisting of 2 digits each and use the methos abv to obtain the product.
ques2:- in a game of chance for 2 players each player is given a random real number . the player who has the larger central digit wins.
Ex: central digit of 324611 is 5 (avg of 4 and 6) central digit of 12341 is 3 ...so the former wins.
WAP that gets a number by using( Math.random ) .. for 2 players 'a' and 'd' and show th winner .this game goes on till the user wants to exit. |
|
abhas Active member
| Subject: Re: pc project Tue Jun 07, 2011 2:37 am | |
| what problem you are having in coding this...i don't want to do ur home work..show me ur code i will help u to debug that or tell at what point u have prob... |
|