Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
How to write a computer program or find a suitable one? Please help/?
I would like to write a computer program to calculate percentage composition, or to gain access to one
that maybe exist already. This is what I want to determine for example, I have three groups of amino acids Polar = S and T, Non-polar V,A,L,G,P and Basic = R. If for example I have the sequence
SRVAL, is there a program I can write or use to make the determination as 20%polar, 20%basic and 60% non-polar.
I have perl installed on my computer, but I have no idea how to use it. Is there other programming software less complicated than perl, that I can use to write a program.
Thanks
2 Answers
- 1 decade agoFavorite Answer
Open up Microsoft Excel, press Alt+F11. In the new "Microsoft Visual Basic" window that opens up right-click "Sheet 1", select "Insert", then "Module"
Now paste the following code in the window.
Function calcComposition(s)
s = UCase(s)
j = Len(s)
If j = 0 Then Exit Function
For i = 1 To j
Select Case Mid(s, i, 1)
Case "S", "T"
polar = polar + 1
Case "V", "A", "L", "G", "P"
nonpolar = nonpolar + 1
Case "R"
basic = basic + 1
End Select
Next
calcComposition = polar * 100 / j & "% polar, " & basic * 100 / j & "% basic and " & nonpolar * 100 / j & "% non-polar"
End Function
Now you can just type
=calcComposition("SRVAL")
in any cell of this workbook and get
20% polar, 20% basic and 60% non-polar
as answer.
=calcComposition("SRSVAL")
will answer with
33.3333333333333% polar, 16.6666666666667% basic and 50% non-polar
Source(s): experience - 1 decade ago
google "Basic Programming Language"
which will offer a download of this simple, and interactive programming language.
Further Google
"Basic Programming Language tutorials"
It's going to give a real start in simple programming language.
Good Luck