Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Guidance needed  RSS feed

 
prathimaprasun rao
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I just want some one to tell me how to write code for the following formulas:

1)READFRE = 206.835 - (1.015 x ASL) - (84.6 x ASW)
2)READFKGL = (.39 x ASL) + (11.8 x ASW) - 15.59

ASL = average sentence length = the number of words divided by the number of sentences.
ASW = average number of syllables per word = the number of syllables divided by the number of words.

waiting for reply.
Thanks in advance
PrathimaPrasun Rao
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by prathimaprasun rao:
...I just want some one to tell me how to write code for the following formulas:

1)READFRE = 206.835 - (1.015 x ASL) - (84.6 x ASW)
2)READFKGL = (.39 x ASL) + (11.8 x ASW) - 15.59...

Use an asterisk (*) instead of the letter 'x' for the multiplication operator, and you should have it. What does your code look like so far?
 
Dhiraj Raut
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya, you can do it like that...

But I even dont think that the brackets are required...

READFRE = 206.835 - 1.015 * ASL - 84.6 * ASW
READFKGL = 0.39 * ASL + 11.8 * ASW - 15.59

will also work...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!