
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Lab; Class: Intro to Bioinformatics; Subject: Bioinformatics; University: Canisius College; Term: Fall 2008;
Typology: Lab Reports
1 / 1
This page cannot be seen from the preview
Don't miss anything!
BIF 101 Lab 8 – relational and logical operators and if statements (ch 5-6)
Assigned: November 6, 2008 Due: November 13, 2008
For each of the following write (1) an algorithm and (2) a program to solve the given problem. Test your program on at least 5 sets of input, paste your code and the test values and results into a word file that you will submit.
Input two numbers and print them out with the smallest first.
Input 3 numbers and print them out in order from smallest to largest.
Input a name and output “match” if it’s your first name otherwise output “no match”.
Input two strings and check for and print messages as follows: Print the two strings Check to see if they are equal, if so print “same” otherwise print “different” Check to see if the first is greater than the second, if so print “first is larger” Check to see if the second is greater than the first, if so print “second is larger”
Input two numbers and divide the first by the second. Test to see what happens when the first number is zero and when the second number is zero.
Input two numbers, if the second is zero print a message that you can not perform division by zero, otherwise divide the first by the second and print the result, also compute and print the result of the first number modulus (%) the second.
Input two numbers, if both are > 0 print “both positive”, if only one is > 0 print “one positive”, if both are zero print “both zero”, if both are negative print “both negative”, if one is negative print “one negative”, if one if zero print “one zero”.
Page 98 Going Back for More: exercises 2 and 3