Preview

Medagenda

Satisfactory Essays
Open Document
Open Document
385 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Medagenda
Testing Palindrome
CLS
INPUT "Enter string to be tested: ";t$ t$=LCASE$(t$) FOR I=LEN(t$) TO 1 STEP -1 r$=r$+MID$(t$, I, 1)
NEXT I
IF r$=t$ THEN PRINT t$; " is Palindrome!"
ELSE
PRINT t$; " is not Palindrome!"
ENDIF
END

Counting vowels in the given string using User Defined Functions
DECLARE FUNCTION countvow(s$)
CLS
INPUT "Enter testing string=";v$
PRINT "Number of vowels=";countvow(v$)
END

FUNCTION countvow(s$)
FOR i=1 TO LEN(s$) ch$=LCASE$(MID$(s$, i, 1)) SELECT CASE ch$ CASE "a", "e", "i", "o", "u" cnt=cnt+1 END SELECT
NEXT i countvow=cnt END FUNCTION

Generate Fibonacci series using Sub Routine
REM a, b, n parameters represents first term, second term and number of terms respectively
DECLARE SUB fibo(a, b, n)
CLS
INPUT "First Term="; x
INPUT "Second Term=";y
REM label number is for data validation that length of terms must be less or equal to 20
10:
INPUT "How many terms="; z
IF z>20 THEN 10
CALL fibo(x, y, z)
END

SUB fibo(a, b, n)
PRINT a, b,
REM first two terms are already printed so started from 3
FOR I = 3 to n s=a+b PRINT s, a=b b=s
NEXT I
END SUB

Sum of digits of a number using User Defined Function (UDF)
DECLARE FUNCTION digitsum(n)
CLS
INPUT "Enter testing number=";v
PRINT "Sum of ";n;" is "; digitsum(v)
END

FUNCTION digitsum(n) a=n WHILE NOT a=0 'writing NOT a=0 is same as writing a0 r=n MOD 10 s=s+r n=int(n/10)
WEND
digitsum=s
END FUNCTION

Testing Armstrong Number using User Defined Function
DECLARE FUNCTION arm(n)
CLS
INPUT "Enter a testing number=";v
IF arm(v)=1 THEN PRINT v;" is Armstrong Number"
ELSE
PRINT v; " is not Armstrong Number"
ENDIF
END

FUNCTION arm(n) f=0 a=n
WHILE a0 r=a MOD 10 s=s+r^3 a=int(a/10)
WEND
IF s=n THEN f=1 arm=f END FUNCTION

Testing Palindrome Using Function...End Function
DECLARE FUNCTION rev$(s$)
CLS
INPUT "Enter string to be tested"; t$

You May Also Find These Documents Helpful

  • Good Essays

    Pharmagen

    • 508 Words
    • 2 Pages

    1. Since there is no obligation to the nonrefundable repayment of the $500 million of funding and Pharma retains intellectual rights (no financial risk for Pharma as per ASC 730-20-25-4), it can be seen as a Research and Development and expensed as incurred according to ASC 730-20-35-1 because no future service can be made. The funding for product X is specified by the investor to be used only for R&D of product X which is not commercialized and not for a future project. The royalties that come from product X are not for a defined period. Product Y is for a defined period. In both cases, both aren’t measured as to how much royalties will be received and whether it can be estimated. Unless there is royalties, the investor gets nothing Since royalties aren’t measurable and are obligations only if product is developed and entity actually receives it, R&D are expensed as incurred for product X as R&D. Incremental funding has the same appearance to be expensed because no future obligation is required.…

    • 508 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Hca 270 Wk 3 Checkpoint

    • 376 Words
    • 2 Pages

    Part 1: For each term in Column A, select the correct definition from Column B on the right. Write the corresponding letter of the definition next to the term.…

    • 376 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Match the Definitions on the left to the correct Terms on the right by entering the correct corresponding alphabetical letter next to the numbers in the first column. Not all terms will be used.…

    • 975 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    The Medicines Company

    • 868 Words
    • 5 Pages

    The Medicines Company Case Write-Up: Terence Cho, Felipe Duarte, Aleks Loiko, Robert Shaw, and James Wang…

    • 868 Words
    • 5 Pages
    Powerful Essays
  • Satisfactory Essays

    Part 1: For each term in Column A, select the correct definition from Column B on the right. Write the corresponding letter of the definition next to the term.…

    • 274 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Part 1: For each term in Column A, select the correct definition from Column B on the right. Write the corresponding letter of the definition next to the term.…

    • 311 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Medcalfe

    • 984 Words
    • 4 Pages

    Emergency Room Care ($302 per visit and 4 visits per year (each quarter) for 20 years) = $24,160…

    • 984 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Medievil Europe

    • 592 Words
    • 3 Pages

    3. Topic sentence states which event was most important in shaping the economics of the Middle Ages…

    • 592 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Sennacherib

    • 1918 Words
    • 5 Pages

    Sennacherib was a prominent king within the Sargonid period that ruled Assyria when it was at its peak. Unlike his predecessors, Sennacherib's reign was largely marked by military campaigns however he did have nine prominent military campaigns which were documented in his famous ‘Palace without Rival’ which will be elaborated on throughout this response.…

    • 1918 Words
    • 5 Pages
    Powerful Essays
  • Satisfactory Essays

    Lorex Pharmaceuticals

    • 380 Words
    • 2 Pages

    Lorex Pharmaceuticals has come up with a new product, Litanol. This medicine seems to have a high potential which is developed for the treatment of high blood pressure. Company has come up with a manufacturing line and production is supposed to be begin next Monday.…

    • 380 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Medical Marihuana

    • 1183 Words
    • 5 Pages

    Throughout the world there have been many different studies on how to cure illness that have led to a medication called Medical Marijuana. Medications are not very effective as they can have many side effects, a very possible addiction problem, and/or death. Prescriptions are all meant to help cure one thing, but they may have many or few consequences, such as liver failure from taking too many of one prescribed medications. The same consequence and many others can be associated with alcohol as well as prescribed medications. However, now there is a new drug that has been known from studies to have a 0% death rate that is introduced in 20 states. This new drug is called Medical Marijuana. New York State’s passage of the bill is to allow New York State Residents the right to use/possess Medical Marijuana and will allow a new medicine with less consequences into the state and bring growth and profit as well.…

    • 1183 Words
    • 5 Pages
    Better Essays
  • Satisfactory Essays

    Cemex

    • 332 Words
    • 2 Pages

    . Cemex has a stronger preference for acquisition over greenfield ventures as an entry mode. Why?…

    • 332 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Medical Marijuana

    • 2250 Words
    • 9 Pages

    Cannabis is the most hated but yet very beneficial drug in the world. The United States has had strict laws against the use and distribution of marijuana since 1937. (The Union, Brett Harvey) Federal and state laws on medicinal marijuana are very different from each other. Cannabis has a lot of health benefits, this is the reason California was the first state to legalize it for medicinal purposes. (How weed won the west, Kevin Booth) People in America have been getting arrested for the use and possession of marijuana since it was outlawed. Charlie Lynch was one of those people in 2008. (Lynching Charlie Lynch, Rick Ray) I believe medical marijuana should be a legally taxed substance in the United States.…

    • 2250 Words
    • 9 Pages
    Better Essays
  • Good Essays

    Program Boolean Test

    • 411 Words
    • 2 Pages

    dim A, B, C, result1, result2, result3, result4, result5, result6, result7, result8, count, count1, bolA, bolB, bolC, X, WshShell…

    • 411 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Medtronic

    • 451 Words
    • 2 Pages

    often than not, this led for too much room for error. Product descriptions were now to be written…

    • 451 Words
    • 2 Pages
    Good Essays