Aviles_Juan_assign2 - char grade = 0 ; // read in total...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/****************************************************/ /* File: Aviles_Juan_Assign2 */ /* */ /* Created by: Juan Aviles */ /* Date: 3 July 2011 */ /* */ /* Program to determine course grade */ /* */ /* Inputs: (keyboard) */ /* 1. Float - weighted total points (<= 100) */ /* */ /* Output: */ /* letter grade using pseudocode grading policy */ /* */ /* Algorithm: Comparisons using if-then-else */ /* */ /****************************************************/ #include <iostream> # using namespace std ; int main () { float score ;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: char grade = 0 ; // read in total score / cout &lt;&lt; endl ; cout &lt;&lt; &quot;Enter total score (float, must be &lt;= 100) : &quot; ; cin &gt;&gt; score ; if (score &gt;= 85) { grade = 'A' ; } else if (score &gt;= 75) { grade = 'B' ; } else if (score &gt;= 65) { grade = 'C' ; } else if (score &gt;= 55) { grade = 'D' ; } else { grade = 'F' ; } g // display the result / cout &lt;&lt; endl ; cout &lt;&lt; &quot;Your grade for CMIS 102 is: &quot; &lt;&lt; grade &lt;&lt; endl ; c return (0); // terminate with success }...
View Full Document

This note was uploaded on 07/19/2011 for the course CMIS 102 taught by Professor M during the Spring '11 term at University of Maryland Baltimore.

Ask a homework question - tutors are online