By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
 428,601 Members | 989 Online + Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,601 IT Pros & Developers. It's quick & easy.

# How do i write algorithms?

 P: 1 Write an algorithm that gets a numeric grade value 0 to 100 from the user, and produces the equivalent letter grade using the standard scale of 90-100 is A, 80-89 is B, 70-79 is C, 60-69 is D, and below 60 is F. The output should resemble: The score entered was 85 and the letter grade is B Compute and display the value x ÷ y if the value of y is not 0. If y does have the value 0, then display the message 'Unable to perform the division.' Compute the volume and circumference of a cylinder given the length L and radius r if the radius is greater than or equal to 1.0; otherwise, your algorithm should compute only the circumference. Write an algorithm that take three numbers and determines which number is the largest of the three and outputs something along the lines of: The largest value of 10, 22, and 11 is 22 Sep 1 '10 #1
Share this Question
3 Replies

 100+ P: 201 the code below should give you an example of how to do the formulas for letter grades. the question is are u going to be creating pointers/virtual pointers or need to inherit their functions for more processing instead of re-writting the code? but for the cylinder this should give you an example as well on how to take the integers given and formulate them. here is an example: Expand|Select|Wrap|Line Numbers //Author Theo Werntz II //CIS 242 //Date 07/21/04 //Project L_2_P_1     #include    using std::cout; using std::cin; using std::endl;       // main functions     int main() {    int total = 0;          // total feed    int feedA = 2.50;     // feedA    int feedB = 3.15;     // feedB          cout << "Enter the letter of feed." << endl         << "The Feed List Is As." << endl     << "Feed A = \$2.50 per 100 lbs."<< endl     << "Feed B = \$3.15 per 100 lbs."<< endl     << "When Finished with Order Press."<

 Expert 100+ P: 2,398 The algorithm is the strategy you use to solve the problem. An algorithm can be expressed in text (like a cookbook recipe), graphically (like a flowchart), or in a computer language. Sep 1 '10 #3

 Expert 100+ P: 983 Don has the right of it. An algorithm is simply an unambiguous statement of how to achieve a result. The rest is implementation. So, since we're not in the homework business, Avery, how about you take a stab at your three and tell us what your algorithms are. Then we can comment on them for you. Cheers! Sep 1 '10 #4

### Post your reply

Sign in to post your reply or Sign up for a free account. 