0% found this document useful (0 votes)
12 views1 page

FKXQJ 3Djh: Mathcad Basics 27

This document discusses using nested if statements to assign grades based on test scores. It provides an example of nested if statements to assign a letter grade (A, B, C, D, or fail) based on a test score. The nested if statements only evaluate the next condition if the previous one is true, avoiding overlapping assignments between grades. This allows assigning a unique grade based on a test score in ranges from 0 to 100.

Uploaded by

Yasonsky Captain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

FKXQJ 3Djh: Mathcad Basics 27

This document discusses using nested if statements to assign grades based on test scores. It provides an example of nested if statements to assign a letter grade (A, B, C, D, or fail) based on a test score. The nested if statements only evaluate the next condition if the previous one is true, avoiding overlapping assignments between grades. This allows assigning a unique grade based on a test score in ranges from 0 to 100.

Uploaded by

Yasonsky Captain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

FKXQJ 3DJH 

Even if one condition is found true, all other conditions are still checke

([DPSOHJUDGHVDQRWKHUZD\
:HFDQMXVWXVHDVHULHVRILIVWDWHPHQWV

grade ( x) := out "you get a D" if x 60
grade ( 50) = "you fail"
out "you get a C" if x 70
grade ( 61) = "you get a D"
out "you get a B" if x 80
grade ( 75) = "you get a C"
out "you get a A" if x 90
grade ( 88) = "you get a B"
out "you fail" if x < 60
out grade ( 93) = "you get a A" 

([DPSOH1HVWHGLIVWDWHPHQWV
1RZZHZLOO1(67WKHLIVWDWHPHQWVLQVWHDGRIXVLQJWKHPLQVHULHV,QWKLVFDVHWKHQH[W
LI  VWDWHPHQW ZLOO RQO\ EH HYDOXDWHG LI WKH SUHYLRXV RQH LV WUXH ,Q WKLV ZD\ ZH ZRQW
RYHUODSDVVLJQPHQWV/HWVORRNDWWKH9HQQGLDJUDPILUVW RQWKHQH[WSDJH 


Mathcad Basics 27

You might also like