chap 4 notes 23 - .. if (score >= 90 ) grade= A...

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

View Full Document Right Arrow Icon
23 Alternative Methods if (score >= 90 ) grade= 'A' ; else if (score >= 80 && score < 90 ) grade= 'B' ; else if (score >= 70 && score < 80 ) grade= 'C' ; else if (score >= 60 && score < 70 ) grade= 'D' ; else grade= 'E' ; Recall the if statement in the previous example: Let’s look at some other ways to do this.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: .. if (score &gt;= 90 ) grade= A ; else if (score &gt;= 80 ) grade= B ; else if (score &gt;= 70 ) grade= C ; else if (score &gt;= 60 ) grade= D ; else grade= E ; Alternative 1:...
View Full Document

Ask a homework question - tutors are online